Lecture # 02 Part B
Lecture # 02 Part B
Fundamentals
Tenth Edition
Floyd
Chapter 2
The column weights of decimal numbers are powers of ten that increase
from right to left beginning with 100 =1:
For digital systems, the binary number system is used. Binary has a radix
of two and uses the digits 0 and 1 to represent quantities.
The column weights of binary numbers are powers of two that increase
from right to left beginning with 20 =1:
…25 24 23 22 21 20.
For fractional binary numbers, the column weights are negative powers
of two that decrease from left to right:
0 000
0
A binary counting sequence for numbers from 1 000
zero to fifteen is shown. 1
2 001
Notice the pattern of zeros and ones in each 0
column. 3 001
Digital counters frequently have this same 1
pattern of digits: 4 010
0
Counter 0 1 0 1 0 1 0 1 0 1 Decoder
5 010
0 0 1 1 0 0 1 1 0 0
1
6 011
0 0 0 0 1 1 1 1 0 0
0
0 0 0 0 0 0 0 0 1 1
7 011
1
8 100
0
Binary Conversions
You can convert decimal to any other base by repeatedly dividing by the
base. For binary, repeatedly divide by 2:
Answer: 1 1 0 0 0 1 remainder
0 1 3 6 12 24 49 2
Continue until the Decimal
Quotient base
last quotient is 0 number
Binary Conversions
MSB
0.188 x 2 = 0.376 carry = 0
0.376 x 2 = 0.752 carry = 0 Most significant bit
0.752 x 2 = 1.504 carry = 1
0.504 x 2 = 1.008 carry = 1
0.008 x 2 = 0.016 carry = 0
Answer = .00110 (for five significant digits)
Binary Addition
1 + 0 + 0 = 01 Sum = 1, carry = 0
1 + 0 + 1 = 10 Sum = 0, carry = 1
1 + 1 + 0 = 10 Sum = 0, carry = 1
1 + 1 + 1 = 11 Sum = 1, carry = 1
Binary Addition
Add the binary numbers 00111 and 10101 and show the
equivalent decimal addition.
0111
00111 7
10101 21
11100 = 28
Binary Subtraction
111
10101
/ / / 21
00111 7
01110 = 14
Outline
• 2-1 Decimal Numbers
• 2-2 Binary Numbers
• 2-3 Binary Conversion
• 2-4 Binary Arithmetic
• 2-5 l's and 2's Complements Of Binary Numbers
• 2-6 Signed Numbers
• 2-7 Floating Point Numbers
• 2-8 Arithmetic Operations with Signed Numbers
• 2-9 Hexadecimal Numbers
• 2-10 Octal Numbers
• 2-11 Binary Coded Decimal (BCD)
• 2-12 Digital Codes
• 2-13 Error Detection Codes
1’s Complement
1 1 0 0 1 0 1 0
0 0 1 1 0 1 0 1
2’s Complement
0 0 1 1 0 1 1 0
Signed Binary Numbers
Examples:
00011110 = +30 00001110 = +14 11111111 = -1
00001111 = +15 11101111 = -17 11111000 = -8
00101101 = +45 11111101 = -3 1 11110111 = -9
Discard carry
Arithmetic Operations with Signed Numbers
Addition: Overflow
- Occurs if the number of bits required for the answer is exceeded
- 8 bit signed (-128 ~ 128)
- Occurs only if both numbers have the same sign.
- Indicated by an incorrect sign bit.
You can think of BCD in terms of column weights in groups of four bits.
For an 8-bit BCD number, the column weights are: 80 40 20 10 8 4 2 1.
Sender Receiver
0101 0101
1101 1100
The parity method is a method of error detection for simple
transmission errors involving one bit (or an odd number of bits).
A parity bit is an “extra” bit attached to a group of bits to force the
number of 1’s to be either even (even parity) or odd (odd parity).
Parity Method
Sender Receiver
Parity bit
01010 01010
Even parity
11011 11001
01011 01011
Odd parity
11010 11000
Selected Key Terms