DOC PREVIEW
U of I CS 231 - Lecture Notes

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 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 28 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 28 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 28 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 28 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 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

DatapathsKeep it simple!An overview of CPU designWhat’s in a CPU?Register transfersRegister transfer languageRegister transfer operationsBlock symbols for registersRegister filesAccessing the register fileWhat’s inside the register fileExplaining the register fileThe all-important ALUALU functionsMy first datapathAn example computationTwo questionsWe can access RAM alsoReading from RAMNotes about this setupMemory transfer notationExample sequence of operationsR3  M[R0]R3  R3 + 1M[R0]  R3Constant inControl unitsSummary01/13/19 Datapaths 1Datapaths•For the rest of the semester, we’ll focus on computer architecture: how to assemble the combinational and sequential components we’ve studied so far into a complete computer.•Today, we’ll start with the datapath, the part of the central processing unit (CPU) that does the actual computations.01/13/19 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 and control units can be a little intimidating.01/13/19 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 the datapath what to do.•Today we’ll look in detail at a processor’s datapath, which is responsible for 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.01/13/19 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 the registers.ALURegisters01/13/19 Datapaths 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 a register transfer language.–The objects in the language are registers.–The basic operations are transfers , where data is copied from one register to another.•We can also use the ALU to perform arithmetic operations on the data while we’re transferring it.ALURegisters01/13/19 Datapaths 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 source register R2 into the destination register R1 in one clock cycle:R1  R2•A conditional transfer is performed only if the Boolean condition in front of the colon is true. To transfer R3 to R2 when K = 1:K: R2  R3•Multiple transfers on the s ame 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.01/13/19 Datapaths 7•We can apply arithmetic operations to registers.R1  R2 + R3R3  R1 - 1 •Logical operations are applied bitwise. AND and OR are denoted with special 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 not modified, and we assume that the shift input is just 0.R2  sl R1 left shiftR2  sr R1 right shiftRegister transfer operations01/13/19 Datapaths 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 outputR0nn01/13/19 Datapaths 9Register files•Modern processors will a number of registers grouped together in a register file.•Much like words stored in a RAM, individual registers are identified by an address.•Here is a block symbol for a2k x n register file.–There are 2k registers, so register addresses are k bits long.–Each register holds an n-bit word, so the data inputs and outputs are n bits wide.nnnk kkD dataWriteD addressA address B addressA data B data Register FileDWRDAAAA B BA01/13/19 Datapaths 10Accessing the register file•You can read two registers at once by supplying the AA and BA inputs. The data appears on the A and B outputs.•You can write to a register by using the DA and D inputs, and setting WR = 1.•These are registers so there must be a clock signal, even though we usually don’t show it in diagrams.–We can read from the register file at any time. –Data is written only on the positive edge of the clock.nnnk kkD dataWriteD addressA address B addressA data B data Register FileDWRDAAAA B BA01/13/19 Datapaths 11What’s inside the register file•Here’s a 4 x n register file. (We’ll assume a 4 x n register file for all our examples.)n nn01/13/19 Datapaths 12Explaining the register file•The 2-to-4 decoder selects one of the four registers for writing. If WR = 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 most arithmetic operations require two operands.01/13/19 Datapaths 13The all-important ALU•The main job of a central processing unit is to “process,” or to perform computations....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 MP2!A BALUFZNCVFSnnnm01/13/19 Datapaths


View Full Document

U of I CS 231 - Lecture Notes

Documents in this Course
Counters

Counters

23 pages

Latches

Latches

22 pages

Lecture

Lecture

33 pages

Lecture

Lecture

16 pages

Lecture

Lecture

4 pages

Datapaths

Datapaths

30 pages

Lecture

Lecture

6 pages

Registers

Registers

17 pages

Datapaths

Datapaths

28 pages

Decoders

Decoders

20 pages

Load more
Download Lecture Notes
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 Lecture Notes 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 Lecture Notes 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?