Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture 6
Amirali Baniasadi amirali@ece.uvic.ca
Combinational Logic
Combinational Logic
Combinational Logic: Output only depends on current input
Design Procedure
1.The number of inputs and outputs? 2.Derive the truth table 3.Obtain the Boolean Function 4.Draw the logic diagram, verify correctness
Full Adder?
Truth Table:
CS 00 01 01 10 01 10 10 11
Half adder ?
10
11
Binary Subtractor
Subtraction is done by using complements
As 2s Complement = A+1
A-B= A + B+1
12
13
Binary Multiplier
Binary mult. Is done the same way of decimal mult.
14
Binary Multiplier
15
16
Decimal adder
When dealing with decimal numbers BCD code is used.
17
Decimal Adder
Decimal numbers should be represented in binary code number. Example: BCD adder Suppose we apply two BCD numbers to a binary adder then: The result will be in binary and ranges from 0 through 19. Binary sum: K(carry) Z8 Z4 Z2 Z1 BCD sum : C(carry) S8 S4 S2 S1 For numbers equal or less than 1001 binary and BCD are identical. For numbers more than 1001, we should add 6(0110) to binary to get BCD. example: 10011(binary) = 11001(BCD) =19 ADD 6 to correct.
18
BCD adder
Numbers that need correction (add 6) are: 01010 (10) 01011 (11) 01100 (12) 01101 (13) 01110 (14) 01111 (15) 10000 (16) 10001 (17) 10010 (18) 10011 (19) Decides to add 6?
Adds 6
19
BCD adder
Numbers that need correction (add 6) are: K Z8 Z4 Z2 Z1 0 1 0 1 0 (10) 0 1 0 1 1 (11) 0 1 1 0 0 (12) 0 1 1 0 1 (13) 0 1 1 1 0 (14) 0 1 1 1 1 (15) 1 0 0 0 0 (16) 1 0 0 0 1 (17) 1 0 0 1 0 (18) 1 0 0 1 1 (19)
C = K + Z8Z4 +Z8Z2
20
Summary
Binary/DECIMAL adder/subtractor multiplier Homework 3: Chapter 4: problems 5,6(a),9, 20(a) Due Monday June 24th.
21