Download presentation
Presentation is loading. Please wait.
1
EEL 3705 / 3705L Digital Logic Design
Fall 2006 Instructor: Dr. Michael Frank Module #11: Signed arithmetic HW and ALUs (Thanks to Dr. Perry for some slides) 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
2
M. Frank, EEL3705 Digital Logic, Fall 2006
Subtraction Circuit 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
3
M. Frank, EEL3705 Digital Logic, Fall 2006
Subtraction Circuit Calculate 2’s complement of B Add –B to A 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
4
M. Frank, EEL3705 Digital Logic, Fall 2006
Add/Sub Circuit 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
5
Add/Sub Circuit Module
12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
6
Function Table for Add/Sub Module
Functional Result S=A+B 1 S=A-B Add is a control input. It is active low. This means that the module will compute A+B when Add=0. It will compute A-B when Add=1. 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
7
M. Frank, EEL3705 Digital Logic, Fall 2006
Add/Sub Circuit Design using Modules 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
8
M. Frank, EEL3705 Digital Logic, Fall 2006
Add/Sub Circuit 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
9
M. Frank, EEL3705 Digital Logic, Fall 2006
Add/Sub Circuit Add operation. Add=0 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
10
M. Frank, EEL3705 Digital Logic, Fall 2006
Add/Sub Circuit Sub operation. Add=1 1 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
11
M. Frank, EEL3705 Digital Logic, Fall 2006
Comparators 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
12
M. Frank, EEL3705 Digital Logic, Fall 2006
Equal Comparator Design a logic circuit which will compute F0 = (A = B) 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
13
2-bit Equal Comparator Truth Table
F0 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
14
2-bit Equal Comparator Truth Table
F0 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
15
M. Frank, EEL3705 Digital Logic, Fall 2006
Solution You can show, 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
16
N-bit Equal Comparator
12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
17
M. Frank, EEL3705 Digital Logic, Fall 2006
Not Equal Comparator Design a logic circuit which will compute F = (A <> B) F = (A = B) i.e. Just invert our Equal Comparator circuit 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
18
M. Frank, EEL3705 Digital Logic, Fall 2006
Magnitude Comparator Design a logic circuit which will compute F2 = (A>B) F1 = (A<B) Let’s develop a truth table for 2-bits 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
19
2-bit Magnitude (unsigned) Comparator Truth Table
F2 F1 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
20
2-bit Magnitude (unsigned) Comparator Truth Table
F2 F1 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
21
M. Frank, EEL3705 Digital Logic, Fall 2006
You can show 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
22
Arithmetic Logic Units (ALUs)
12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
23
Arithmetic Logic Unit (ALU)
A,B are data inputs of n bits each in depth S is a control input. We have 2m operations F is the output 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
24
M. Frank, EEL3705 Digital Logic, Fall 2006
Example Let n=4,m=3 We have A[3..0] and B[3..0] With m=3, we have 23 = 8 operations Let’s look at a possible function table 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
25
M. Frank, EEL3705 Digital Logic, Fall 2006
Function Table s2 s1 s0 Function F=AB 1 F=A+B (logical OR) F=NOT A F=A XOR B F=A+B (Arithmetic) F=A-B F=A + 1 F=A - 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
26
Design using a Truth Table
How large is the truth table? 2n from data inputs A and B Example: n=8, we have 16 data inputs A[7..0] and B[7..0] 3 control inputs Total of 2n+3 inputs N=8, we have 19 inputs Our truth table will have 192 (361) rows and 8 outputs Too complex. Let’s explore another alternative using a “system” or modular approach 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
27
M. Frank, EEL3705 Digital Logic, Fall 2006
Design using Modules Note: For S2=0, we have logic operations For S2=1, we have arithmetic operations So, let’s use S2 to control a 2x1 MUX to select between logic and arithmetic operations, so our top level design would look like: 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
28
M. Frank, EEL3705 Digital Logic, Fall 2006
ALU Design 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
29
M. Frank, EEL3705 Digital Logic, Fall 2006
ALU Design S2=0 With S2=0, F is the output from the logic module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
30
M. Frank, EEL3705 Digital Logic, Fall 2006
ALU Design S2=1 With S2=1, F is the output from the arithmetic module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
31
M. Frank, EEL3705 Digital Logic, Fall 2006
Logic Module Design 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
32
Function Table for Logic Module
S2=0 s2 s1 s0 Function F=AB 1 F=A+B (logical OR) F=NOT A F=A XOR B We can use a 4x1 mux to implement this module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
33
M. Frank, EEL3705 Digital Logic, Fall 2006
Logic Module Design 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
34
M. Frank, EEL3705 Digital Logic, Fall 2006
Logic Module Design F=AB AND Operation S[1..0]=00 0 0 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
35
M. Frank, EEL3705 Digital Logic, Fall 2006
Logic Module Design F=A+B OR Operation S[1..0]=01 0 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
36
M. Frank, EEL3705 Digital Logic, Fall 2006
Logic Module Design F=A NOT Operation S[1..0]=10 1 0 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
37
M. Frank, EEL3705 Digital Logic, Fall 2006
Logic Module Design F=A XOR B XOR Operation S[1..0]=11 1 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
38
What do these logic modules look like?
12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
39
M. Frank, EEL3705 Digital Logic, Fall 2006
AND Module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
40
M. Frank, EEL3705 Digital Logic, Fall 2006
OR Module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
41
M. Frank, EEL3705 Digital Logic, Fall 2006
NOT Module A F 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
42
M. Frank, EEL3705 Digital Logic, Fall 2006
XOR Module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
43
Let’s use our ADD/SUB Module
Arithmetic Module Let’s use our ADD/SUB Module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
44
Add/Sub Circuit Module
12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
45
Function Table for Arithmetic Ops
1 F=A+B (Arithmetic) F=A-B F=A + 1 F=A - 1 Note: S0 can be use to indicate Addition or Subtraction. S1 can be use to indicate the B data input 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
46
Arithmetic Module Design
B A S 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
47
Arithmetic Module Design
B A S F=A+B S[1..0]=00 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
48
Arithmetic Module Design
B A S F=A-B S[1..0]=01 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
49
Arithmetic Module Design
B A S F=A+1 S[1..0]=10 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
50
Arithmetic Module Design
B A S F=A-1 S[1..0]=11 1 1 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
51
M. Frank, EEL3705 Digital Logic, Fall 2006
Overall Design We have 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
52
M. Frank, EEL3705 Digital Logic, Fall 2006
ALU Design 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
53
M. Frank, EEL3705 Digital Logic, Fall 2006
Logic Module Design 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
54
Arithmetic Module Design
B A S 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
55
M. Frank, EEL3705 Digital Logic, Fall 2006
Total Design Logic Module Arithmetic Module 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
56
M. Frank, EEL3705 Digital Logic, Fall 2006
End of Chapter 4 12/4/2018 M. Frank, EEL3705 Digital Logic, Fall 2006
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.