Download presentation
1
2-input AND/OR/XOR gates Inverters 2:1 MUX
Design a 4-bit ALU that implements the following set of operations with only the following components (assume 2’s complement number representation, no need to implement overflow circuit) 1-bit Full-Adders (FA) 2-input AND/OR/XOR gates Inverters 2:1 MUX M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B
2
M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B
3
M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment
Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B MUX M2 Fi
4
M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment
Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B A * 2 = left-shift e.g. 3 * 2 = “011” * 2 = “110” = 6 A / 2 = right-shift e.g. 3 / 2 = “011” / 2 = “001” = 1 MUX M1 MUX M2 Fi
5
M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment
Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 A * 2 = left-shift e.g. 3 * 2 = “011” * 2 = “110” = 6 MUX M0 A / 2 = right-shift e.g. 3 / 2 = “011” / 2 = “001” = 1 MUX M1 MUX M2 Fi
6
M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment
Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 MUX MUX M0 M0 MUX M1 MUX M2 Fi
7
M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment
Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 MUX MUX M0 M0 MUX M1 MUX M2 Fi
8
M2 M1 M0 Function Name F = Add A + B 1 Subtract A – B 1 Increment
Add A + B 1 Subtract A – B 1 Increment A + 1 1 1 Decrement A – 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 MUX MUX M0 M0 Ai MUX M1 FA Ci+1 Ci MUX M2 Fi
9
M2 M1 M0 Function Name F = C0 Add A + B Bi 1 Subtract A – B NOT(Bi) 1
Add A + B Bi 1 Subtract A – B NOT(Bi) 1 1 Increment A + 1 “0” 1 1 1 Decrement A – 1 “1” 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 MUX MUX M0 M0 Ai MUX M1 FA Ci+1 Ci MUX M2 Fi
10
M2 M1 M0 Function Name F = C0 Add A + B Bi 1 Subtract A – B NOT(Bi) 1
Add A + B Bi 1 Subtract A – B NOT(Bi) 1 1 Increment A + 1 “0” 1 1 1 Decrement A – 1 “1” 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
11
M2 M1 M0 Function Name F = C0 Add A + B Bi 1 Subtract A – B NOT(Bi) 1
Add A + B Bi 1 Subtract A – B NOT(Bi) 1 1 Increment A + 1 “0” 1 1 1 Decrement A – 1 “1” 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
12
M2 M1 M0 Function Name F = C0 Add A + B Bi 1 Subtract A – B NOT(Bi) 1
Add A + B Bi 1 Subtract A – B NOT(Bi) 1 1 Increment A + 1 “0” 1 1 1 Decrement A – 1 “1” 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
13
M2 M1 M0 Function Name F = C0 Add A + B Bi 1 Subtract A – B NOT(Bi) 1
Add A + B Bi 1 Subtract A – B NOT(Bi) 1 1 Increment A + 1 “0” 1 1 1 Decrement A – 1 “1” 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
14
M1 M0 M2 M1 M0 Function Name F = C0 Add A + B Bi 1 Subtract A – B
Add A + B Bi 1 Subtract A – B NOT(Bi) 1 1 Increment A + 1 “0” 1 1 1 Decrement A – 1 “1” C0 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
15
M1 M0 M2 M1 M0 Function Name F = C0 1 1 Ai Bi Ai Bi 1 1 Ai-1 Ai+1 Bi
C0 1 1 Ai Bi Ai Bi 1 1 Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
16
M1 M0 M2 M1 M0 Function Name F = C0 1 1 Ai Bi Ai Bi 1 1 Bitwise-AND
C0 1 1 Ai Bi Ai Bi 1 1 Bitwise-AND A AND B 1 1 1 Bitwise-OR A OR B Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
17
M1 M0 M2 M1 M0 Function Name F = C0 1 1 Multiply by 2 A * 2 1 1
C0 1 1 Multiply by 2 A * 2 1 1 Divide by 2 A / 2 Ai Bi Ai Bi 1 1 Ai-1 Ai+1 Bi M0 MUX MUX M0 M0 M0 Ai MUX M1 MUX M1 FA Ci+1 Ci MUX M2 Fi
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.