Professional Documents
Culture Documents
CSE 205 - Chapter1
CSE 205 - Chapter1
CSE 205 - Chapter1
TEXTBOOK
Other Books: Digital Fundamentals by Thomas L. Floyd Digital Design by E. L. Johnson and M.A Karim Digital Logic and Computer Design by M. Morris Mano
DIGITAL SYSTEMS
Why study digital logic design To design large digital systems with a easier and mathematically sound abstraction Digital Systems Example: digital cameras, digital telephones, digital television, digital computers Used in communication, business transactions, traffic control, space guidance, medical treatment, weather monitoring, the Internet
TECHNOLOGY CHANGE
DIGITAL SYSTEMS
BINARY LOGIC
In a digital system, all signals take on discrete values. Also referred as states Most modern digital systems operate on 2 discrete states Binary logic system Deals with binary variables and a set of logical operations
BINARY LOGIC
We represent the two states of binary variable as True and false 1 and 0 High and Low Three basic logic operations AND : x. y = z or xy = z OR: x + y = z NOT: x = z
TRUTH TABLE
A truth table is a table of all possible combinations of the variables showing the relation between the values that the variables may take and the result of the operation.
LOGIC GATES
Logic gates are electronic circuits that operate on one or more input signals to produce an Output signal.
LOGIC GATES
BOOLEAN FUNCTION
f(x,y,z) = (x + yz )
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
0 1 0 0 1 1 1 1
LOGIC GATES
NUMBER SYSTEMS
Consists of TWO Things: A BASE or RADIX Value A SET of DIGITS Digits are symbols representing all values less than the radix value. Example is the Common Decimal System: RADIX (BASE) = 10 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
Consider: 5032.21
(5032 .21)10 5 (10 ) 3 0 (10 ) 2 3 (10 )1 2 (10 ) 0 2 (10 ) 1 1 (10 ) 2 5000 0 30 2 0.2 0.01
Other Notation: (5032.21)10 In general, a number expressed in a base-r system has coefficients multiplied by powers of r:
Binary to Decimal:
(1101.01)2 1 23 1 22 0 21 1 20 0 21 1 22 (13.25)10
6 10 26 10 53 10 211 10
b)
c)
d)
Octal to Decimal:
(15.2)8 1 81 5 80 2 81 (13.25)10
Hexadecimal to Decimal:
Example: (13)10
Quotient Remainder
Coefficient
6 3 1 0
1 0 1 1
a0 = 1 a1 = 0 a2 = 1 a3 = 1
b)
c)
d)
Example: (0.625)10
Integer Fraction
Coefficient
1 0 1
. . .
25 5 0
175 / 8 = 21 / 8 = 2 /8=
21 2 0
7 5 2
a0 = 7 a1 = 5 a2 = 2
Answer:
Example: (0.3125)10
Integer Fraction Coefficient
2 4
. .
5 0
a-1 = 2 a-2 = 4
Octal 0
1 2 3 4
Binary 000
001 010 011 100 101 110 111
Example:
Assume Zeros
( 1 0 1 1 0 . 0 1 )2
( 2
. 2 )8
5 6
Hex
0 1 2 3 4 5 6 7 8 9 A B C D E F
Binary
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Example:
Assume Zeros
( 1 0 1 1 0 . 0 1 )2
(1
. 4 )16
( 2
2 )8
Assume Zeros
Assume Zeros
( 0 1 0 1 1 0 . 0 1 0 )2
(1
4 )16
BINARY ADDITION
1 1 1 1 1 1
1 1 1 1 0 1
+ 1 0 1 1 1
= 61 = 23 = 84
1 0 1 0 1 0 0
(2)10
BINARY SUBTRACTION
1 2 0 2 2 0 0 2
1 0 0 1 1 0 1 1 0 1 1 1 0 1 1 0 1 1 0
= (10)2
= 77 = 23 = 54
BINARY MULTIPLICATION
1 0 1 1 1
x 1 0 1 0
0 0 0 0 0
1 0 1 1 1 0 0 0 0 0
1 0 1 1 1 1 1 1 0 0 1 1 0
COMPLEMENTS
They are used to simplify the subtraction operation Two types (for each base-r system) Diminishing radix complement (r-1s complement) Radix complement (rs complement)
(r 1) N
n
r N
n
33
RADIX COMPLEMENT
The r's complement of an n-digit number N in base r is defined as rn N for N 0 and as 0 for N = 0. The r's complement can also be obtained by adding 1 to the (r 1) 's complement, since rn N = [(rn 1) N] + 1. Decimal Number: 10n - N Example: 10s complement of 246700 is 753300
10110000 01001111
10110000
1 01010000 01 010000
MN Add M to rs complement of N Sum = M+(rn N) = M N+ rn If M > N, Sum will have an end carry rn , discard it If M<N, Sum will not have an end carry and n Sum = r (N M) (rs complement of N M) So M N = (rs complement of Sum)
65438 - 5623 65438 10s complement of 05623 +94377 159815 Discard end carry 105 Answer -100000 59815
5623 - 65438 05623 10s complement of 65438 +34562 There is no 40185 end carry.
39
10110010 - 10011111 10110010 2s complement of 10011111 Discard end carry 2^8 Answer +01100001 100010011 - 100000000 00010011
Binary Systems
40
10011111 -10110010 10011111 2s complement of 10110010 +01001110 There is no 11101101 end carry.
Binary Systems
41
1s complement of 10011111
End-around carry Answer
+01100000
100010010 + 1 00010011
10011111 -10110010 10011111 1s complement of 10110010 +01001101 There is no 11101100 end carry.
Binary Systems
43
+5
+11 +16 +5 -11 -6
00000101
00001011 00010000 00000101 11110101 11111010
-5 +11 +6
-5
11111011
-11
11110101
Discard
-16 111110000
In 2s-complement form:
1. Take the 2s complement of the subtrahend (including the sign bit) and add it to the minuend (including sign bit). 2. A carry out of sign-bit position is discarded.
( A) ( B ) ( A) ( B ) ( A) ( B ) ( A) ( B )
Example:
(11111010 11110011) (11111010 + 00001101) 00000111 (+ 7)
( 6) ( 13)
A number with k decimal digits will require 4k bits in BCD. A decimal number in BCD is the same as its equivalent binary number only when the number is between 0 and 9..
BCD addition
The advantage is that only bit in the code group changes in going from one number to the next. Error detection. Representation of analog data. Low power design.
Gray Code The advantage is that only bit in the code group changes in going from one number to the next. Error detection. Representation of analog data. Low power design.