Single-cycle Datapath and pipelining Flashcards
What are the 5 steps in the datapath when executing an instruction?
1.
Use PC to fetch instruction from instruction memory.
Next PC is also computed as either (PC + 4) or target address
2.
Grab registers from instruction and accesses the register file to read registers that needs to be read
- Instruction is executed.
ALI (arithmetic result, calculate address for load/store, calculate target of branch address)
4.
Access memory (if necessary)
5.
Write result to register file (if there is a result)
What are multiplexers used for?
Can’t join wires together, so combine multiplexers with control signals to determine which input is used
What logical value does Low voltage/ground have?
0
How many bits are there per wire?
One bit per wire
How are multi-bit data encoded?
On multi-wire buses
What are to types of circuit elements used in creating a data path
Combinational element
State (sequential) element
What is an combinational element?
Operate on data
The output is a function of input.
AND, Adder, Multiplexer, ALU
What is an state (sequential) element?
Stores data
Basic unit is a flip flop.
Stores values on its input, and does it on the rising edge of the clock.
It is common to assemble flip flops into registers to be able to store multibit values that has something to do with each other
What does an adder do?
Binary addition of two binary numbers
Y = A + B
How does a multiplexer compute its outout?
Y = S ? I1 : I0
I1: Input 1
I0: Input 0
S: Selector signal
What is a critical path?
The worst case latency between two state elements.
The latency the signal must traverse within a clock cycle.
Avoids for example storing values before the input is comletely ready.
What is the data path?
Elements that process data and addresses in the CPU (Registers, ALUs, mux’s, memories)
How are instructions fetched using a PC?
PC is a 32-bit register (addresses are 32 bit)
Output of PC is addresses in instruction memory
PC output are used to fetch instruction from instruction memory
What happens in parallell during instruction fetch
While the PC is used to fetch the instruction from instruction memory,
The current PC is incremented by 4 to get the address of the next instruction.
How are ALU instructions executed?
- Need to read 2 register operands
- Perform the operation
- Write result
Components: Register file, ALU
What are the components of a register file?
2 read ports:
- both 5 bit wide (instruction format have 5 bits for specifying registers)
2 output (ports?) that go into the input of ALU
write input port: write registers
write data input port: to write data
RegWrite signal: Makes sure we don’t write register unless we need to.