DOC PREVIEW
U of I CS 231 - Datapaths

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Datapaths 1Datapaths• For the rest of the semester, we’ll focus on computer architecture: howto assemble the combinational and sequential components we’ve studiedso far into a complete computer.• Today, we’ll start with the datapath, the part of the central processingunit (CPU) that does the actual computations.Datapaths 2Keep it simple!•Abstraction is very helpful in understanding processors.– Although we studied how devices like registers and muxes are built,we don’t need that level of detail here.– You should focus more on what these component devices are doing,and less on how they work.• Otherwise it’s easy to get bogged down in the details, and datapath andcontrol units can be a little intimidating.Datapaths 3An overview of CPU design• We can divide the design of our CPU into three parts:– The datapath does all of the actual data processing.– An instruction set is the programmer’s interface to CPU.– A control unit uses the programmer’s instructions to tell thedatapath what to do.• Today we’ll look in detail at a processor’s datapath, which is responsiblefor doing all of the dirty work.– An ALU does computations, as we’ve seen before.– A limited set of registers serves as fast temporary storage.– A larger, but slower, random-access memory is also available.Datapaths 4What’s in a CPU?• A processor is just one big sequential circuit.– Some registers are used to store values, which form the state.– An ALU performs various operations on the data stored in theregisters.ALURegistersDatapaths 5Register transfers• Fundamentally, the processor is just moving data between registers,possibly with some ALU computations.• To describe this data movement more precisely, we’ll introduce aregister transfer language.– The objects in the language are registers.– The basic operations are transfers, where data is copied from oneregister to another.• We can also use the ALU to perform arithmetic operations on the datawhile we’re transferring it.ALURegistersDatapaths 6Register transfer language• Two-character names denote registers, such as R0, R1, DR, or SA.• Arrows indicate data transfers. To copy the contents of the sourceregister R2 into the destination register R1 in one clock cycle:R1 ← R2• A conditional transfer is performed only if the Boolean condition infront of the colon is true. To transfer R3 to R2 when K = 1:K: R2 ← R3• Multiple transfers on the same clock cycle are separated by commas.R1 ← R2, K: R2 ← R3• Don’t confuse this register transfer language with assembly language,which we’ll discuss next week.Datapaths 7• We can apply arithmetic operations to registers.R1 ← R2 + R3R3 ← R1 - 1• Logical operations are applied bitwise. AND and OR are denoted withspecial symbols, to prevent confusion with arithmetic operations.R2 ← R1 ∧ R2 bitwise ANDR3 ← R0 ∨ R1 bitwise OR• Lastly, we can shift registers. Here, the source register R1 is notmodified, and we assume that the shift input is just 0.R2 ← sl R1 left shiftR2 ← sr R1 right shiftRegister transfer operationsDatapaths 8Block symbols for registers• We’ll use this block diagram to represent an n-bit register.• There is a data input and a load input.– When Load = 1, the data input is stored into the register.– When Load = 0, the register will keep its current value.• The register’s contents are always available on the output lines,regardless of the Load input.• The clock signal is not shown because it would make the diagram messy.• Remember that the input and output lines are actually n bits wide!LoadData inputData outputR0nnDatapaths 9A better parallel load• Another idea is to modify the flip-flop D inputs and not the clock signal.– When LD = 0, the flip-flop inputs are Q3-Q0, so each flip-flop justkeeps its current value.– When LD = 1, the flip-flop inputs are D3-D0, and this new value is“loaded” into the register.Datapaths 10Register files• Modern processors contain anumber of registers groupedtogether in a register file.• Much like words stored in aRAM, individual registers areidentified by an address.• Here is a block symbol for a2k x n register file.– There are 2k registers, soregister addresses are kbits long.– Each register holds an n-bit word, so the datainputs and outputs are nbits wide.nnnk kkD dataWriteD addressA address B addressA data B data Register FileDWRDAAAA B BADatapaths 11Accessing the register file• You can read two registers atonce by supplying the AA andBA inputs. The data appearson the A and B outputs.• You can write to a register byusing the DA and D inputs,and setting WR = 1.• These are registers so theremust be a clock signal, eventhough we usually don’t showit in diagrams.– We can read from theregister file at any time.– Data is written only onthe positive edge of theclock.nnnk kkD dataWriteD addressA address B addressA data B data Register FileDWRDAAAA B BADatapaths 12What’s inside the register file• Here’s a 4 x n register file. (We’ll assume a 4 x n register file for allour examples.)n nnDatapaths 13What’s inside the register file• Here’s a 4 x n register file. (We’ll assume a 4 x n register file for allour examples.)nnnDatapaths 14Explaining the register file• The 2-to-4 decoder selects one of the four registers for writing. IfWR = 1, the decoder will be enabled and one of the Load signals willbe active.• The n-bit 4-to-1 muxes select the two register file outputs A and B,based on the inputs AA and BA.• We need to be able to read two registers at once because mostarithmetic operations require two operands.Datapaths 15The all-important ALU• The main job of a central processing unit is to “process,” or to performcomputations....remember the ALU from way back when?• We’ll use the following general block symbol for the ALU.– A and B are two n-bit numeric inputs.– FS is an m-bit function select code, which picks one of 2m functions.– The n-bit result is called F.– Several status bits provide moreinformation about the output F:• V = 1 in case of signed overflow.• C is the carry out.• N = 1 if the result is negative.• Z = 1 if the result is 0.• This should all look familiar from previoushomeworks!A BALUFZNCVFSnnnmDatapaths 16ALU functions• For concrete examples, we’ll use theALU as it’s presented in the textbook.• The table of operations on the right istaken from page 457.• The function


View Full Document

U of I CS 231 - Datapaths

Documents in this Course
Counters

Counters

23 pages

Latches

Latches

22 pages

Lecture

Lecture

33 pages

Lecture

Lecture

16 pages

Lecture

Lecture

4 pages

Lecture

Lecture

6 pages

Registers

Registers

17 pages

Datapaths

Datapaths

28 pages

Decoders

Decoders

20 pages

Load more
Download Datapaths
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Datapaths and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Datapaths 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?