datapath components and tradeoffs chapters 4.1 - 4
TRANSCRIPT
![Page 1: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/1.jpg)
Chapter 4
Datapath Components and tradeoffsChapters 4.1 - 4.8
![Page 2: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/2.jpg)
Datapath components
● Datapath components are larger building blocks commonly used inside a CPU.
● The sequential datapath components include:– Registers with parallel load
– Shift Registers
– Rotate Registers
– Multi-function Registers
![Page 3: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/3.jpg)
Parallel Load Register
● Adds an additional signal called LOAD● Selects between the current state or the
data in.● Uses a 2-to-1 Mux to select.
![Page 4: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/4.jpg)
Shift Register
● Has a serial in and serial out signal.● The amount of shift depends on the number
of flip-flops.
![Page 5: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/5.jpg)
Rotate Register
● Specialized Shift register where the output is feed back into the input.
● Need a way to initialize the register or select an external input.
![Page 6: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/6.jpg)
Multi-function register
● A register with multiple inputs and operations.
● Controlled by select lines.● Two select lines uses 4-to-1 Muxes.
![Page 7: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/7.jpg)
Datapath components
● The combinational datapath components include:– Adders (subtractors)
– Comparators
– Multipliers
– Arithmetic Logic Units (ALU)
– Shifters
![Page 8: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/8.jpg)
Adders
● Consider adding two 32-bit numbers. How many input signals? How many output signals?
● We need a better way to design a large adder. Consider adding two numbers column by column
● Design a circuit for a column addition.
![Page 9: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/9.jpg)
Adders
● A Half Adder adds two inputs, A and B. It has two outputs, S and Cout.
● A Full Adder adds three inputs, A, B, and Cin. It has two outputs, S and Cout.
● Use the design process to design each circuit.
![Page 10: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/10.jpg)
Adders
● Design a 4-bit adder using Full Adders.● Consider how long it takes to add two 4-bit
numbers. Use a propagation delay of 1 nS for an inverter, 2 nS for an OR gate and 3 nS for an AND gate.
● Calculate the maximum delay from any input to any output.
● What is the propagation delay of a 32-bit adder using 4-bit adder components?
![Page 11: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/11.jpg)
Comparators
● Design a circuit that compares two 4-bit numbers for equality (Identity comparator).
● Design a Magnitude Comparator circuit using a carry-ripple style. Outputs A>B, A==B, and A<B signals.
![Page 12: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/12.jpg)
Multiplication
● An MxN multiplier will have M + N output bits.
● Design a 4x4-bit multiplier
![Page 13: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/13.jpg)
Subtraction
● How to represent a negative number– Signed magnitude
– Complements● 1's complement● 2's complement
![Page 14: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/14.jpg)
Subtraction
● Design a 4-bit Adder/Subtraction circuit● Overflow detection.
![Page 15: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/15.jpg)
ALU
● Arithmetic Logic Unit operations– Bitwise logic operartions
● AND● OR● NOT● XOR
– Add– Subtract– Other operations
![Page 16: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/16.jpg)
Shifting
● N-bit shifter● Shift left● Shift right● Arithmetic shift● Circular shift (rotate)
![Page 17: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/17.jpg)
Barrel Shifter
● 8-bit barrel shifter
![Page 18: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/18.jpg)
Counters
● Counters increment (or decrement) the binary value by 1 each clock cycle.
● Use the design procedure to design a 4-bit counter.
● Counters have an extra output signal to indicate the count has reached its terminal count.
● Counters may have a Count Enable input signal.
![Page 19: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/19.jpg)
Modulo Counter
● Design a 4-bit counter that counts to 9 and starts over at 0.
![Page 20: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/20.jpg)
Ripple Counter
● A counter that can divide a clock frequency by 2, 4, 8, etc.
![Page 21: Datapath Components and tradeoffs Chapters 4.1 - 4](https://reader034.vdocuments.mx/reader034/viewer/2022050612/6273a7d3460fd14dd8148ae3/html5/thumbnails/21.jpg)
Register Files
● An array of registers.● A register is selected using decoders and
Muxes.● May use Three State Buffers instead of a
Mux.● Acts like an array of memory