Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Number Systems - Discrete Mathematical Structures - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Number Systems, Logic of Compound Statements, Circuits for Addition, Karnaugh Maps, Decimal Representation, Number Sentence, Binary Representation, Converting Binary to Decimal, Binary Addition, Binary Subtraction

Typology: Slides

2012/2013

Uploaded on 04/27/2013

ashwini
ashwini 🇮🇳

4.5

(18)

177 documents

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 1
The Logic of Compound Statements
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Number Systems - Discrete Mathematical Structures - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Chapter 1

The Logic of Compound Statements

Section 1.

Number Systems and Circuits for Addition Karnaugh Maps

Binary Representation

  • Binary numbers (base 2) are sequence of {0,1}digits. The value of the number depends on it’s location in the sequence. - Binary: 1101 => 1x8 + 1x4 + 0x2 + 1 - 1x2 3 + 1x2 2 + 1x2^1 + 1x2 0 - = (decimal) 8+4+0+1 = 13 (^10) - Binary: 10101 => 1x16 + 0x8 + 1x4 + 0x2 + 1 - 1x2 4 + 0x2 3 + 1x2^2 + 1x2 1 + 1x2 0 - = (decimal) 16+0+4+0+1 = 21 (^10)

Converting Binary to Decimal

  • Converting from binary to decimal is performed by expanding the binary to a number sentence and summing over the number sentence. - Example: - 1101012 = 1x2^5 + 1x2^4 + 0x2^3 + 1x2^2 + 0x2^1 + 1x2^0 = 53 10

Example

  • Convert 209 10 to binary
  • Answer: 11010001

Binary Addition

  • Binary addition is performed in the same manner as decimal addition.
  • When and how do you perform a carry?
    • Carry is dependent on the base. Sum greater than the (base – 1) results in a carry.
    • Example:
      • 12 + 0 2 = 1 (no carry)
      • 02 + 1 2 = 1 (no carry)
      • 12 + 1 2 = 10 2 (carry)

Binary Subtraction

  • Binary subtraction is performed in the same manner as decimal subtraction.
  • When and how do you perform a borrow?
    • Borrow is dependent on the base. In decimal you borrow a 10’s value from the adjoining digit, however, in binary you borrow a 10 2 (2 10 ).
    • Example:
      • 1 2 - 0 2 = 1 (no borrow)
      • 1 2 - 1 2 = 0 (no borrow)
      • 10 2 - 1 2 = 01 2 (borrow from 2’s position)
      • 2 10 – 1 10 = 1 10 (check)

Examples

Addition Circuits

Half-Adder

Addition Circuits

Full-Adder

  • A full adder requires three inputs, (P, Q) and a carry in (R).

Addition Circuits

Full-Adder

  • Full-adder can be constructed from two half- adders.

2-

Unsigned Integers

  • Non-positional notation
    • could represent a number (“5”) with a string of ones (“11111”)
    • problems?
  • Weighted positional notation
    • like decimal numbers: “329”
    • “3” is worth 300, because of its position, while “9” is only worth 9

329 102 101 100

22 21 20 3x100 + 2x10 + 9x1 = 329 1x4 + 0x2 + 1x1 = 5

most significant least significant

2-

Signed Integers

  • With n bits, we have 2 n^ distinct values.
    • assign about half to positive integers (1 through 2n-1) and about half to negative (- 2n-1^ through -1)
    • that leaves two values: one for 0, and one extra
  • Positive integers
    • just like unsigned – zero in most significant (MS) bit 00101 = 5
  • Negative integers
    • sign-magnitude – set MS bit to show negative, other bits are the same as unsigned 10101 = -
    • one’s complement – flip every bit to represent negative 11010 = -
    • in either case, MS bit indicates sign: 0=positive, 1=negative

2-

Two’s Complement

  • Problems with sign-magnitude and 1’s complement
    • two representations of zero (+0 and –0)
    • arithmetic circuits are complex
      • How to add two sign-magnitude numbers? – e.g., try 2 + (-3)
      • How to add to one’s complement numbers?
        • e.g., try 4 + (-3)
  • Two’s complement representation developed to make circuits easy for arithmetic.
    • for each positive number (X), assign value to its negative (-X), such that X + (-X) = 0 with “normal” addition, ignoring carry out 00101 (5) 01001 (9) + 11011 (-5) + (-9) 00000 (0) 00000 (0)