Anda di halaman 1dari 3

CS37 Summer 2002, Homework 5

Due on Friday, August 2nd, at the beginning of class.


PROBLEM Datapath Design
In this problem you will design the datapath and control logic to implement what is called The Third Multiplication Algorithm in our textbook. The algorithm, for which the flowchart is repeated below, is described in PH2 pages 256-258.

Start

Product0 = 1

1. Test Product0

Product0 = 0

1a. Add multiplicand to the left half of the product and place the result in the left half of the Product register

2. Shift the Product register right 1 bit

32nd repetition?

No: < 32 repetitions

Yes: 32 repetitions Done

Analyzing this flowchart, you will notice that the hardware that implements it will require a 64-bit register capable of performing right-shifts and an ALU that can add 32-bits. You will not have to deal with such large operands so the multiplication circuit you will design will have different specifications: your hardware will have to receive two 8-bit operands from hex keyboards and store them in registers for a multiplicand and a multiplier. The result of the multiplication will be held in another register hooked up to hex displays.

The basic schematic for the hardware youll use is the same assumed in Fig. 4.31, in page 257 of your textbook, and a LogicWorks implementation of it has been provided for you. The difference between the circuit in the book and the one youre being given lies in the fact that we work with 8-bit (not 32-bit) operands. The ALU was replaced by an 8-bit adder and the accumulator register used to store the product is 16-bit wide rather than 32bit wide. The LogicWorks file is available from a link in our web page, next to where you downloaded this very document, in case you havent noticed it.

Multiplicand 32 bits

32-bit ALU

Product 64 bits

Shift right Write

Control test

Also, note that Product is a 16-bit register (not 64) that can do right shifts and which can have each of its 8-bit halves independently accessed. The hex keypads allow you to set the A and B inputs (multiplicand and multiplier). The 4x8 multiplexer allows you to load one of the following into the upper half of the Product register, that is Product(Hi): 0x0000 Product(Hi) (no change) Product(Hi) + A

The 2x8 multiplexer allows you to put one of the following on Product(Lo)'s input: B Product(Lo) (no change)

When the signal labeled WRT is high, the value on R-shift-16's inputs is loaded into the Product register. When signal labeled SHFT is high, the current value in Product is shifted right 1 bit at each clock cycle. When both these signals are 0, the value remains of Product unchanged. If both signals are high, the results on Product are undefined.

Your job is to design the circuit that goes into the Control Unit box in this circuit, which is currently empty. You will design a circuit to drive the values of control signals in this datapath, namely the controls for the multiplexers and the shift register. The GO button in this circuit allows you tell the finite state machine that you will put inside the Control Unit box to start running. Once youve loaded values (unsigned integers) into A and B, pressing GO will kickstart your control unit and execute the multiplication algorithm (this toggle button sets the D flip-flop to 1 until the beginning of the next clock cycle, at which point the flip-flop gets reset back to zero). CLK is the input for the clock, which will regulate your control circuit. LSB is the input for the least significant bit of the product. The other pins are the outputs for the rest of the circuit. You will present your design step-by-step according to the script below. Your circuit file will be named according to the usual convention and deposited in the HW5 dropbox in PUBLIC (CS37-X02-HW5-lastname-firstname). Design methodology: i) Identify the states for the finite state machine in your control unit and draw its diagram with bubbles and arrows. Make sure that at the end of the multiplication, your FSM comes back to your Start state, so that the user can change the operands and computer another product. Label each state with a bit pattern that uniquely identifies it. Give the truth table for the output function of your FSM. This table completely describes the value of the control outputs based on the current state of the machine (this is a Moore machine after all). Design the circuit for your output function. Figure out how many flip-flops you need to implement your machine. This number is a function of the number of states in your diagram for (i). Hook up your flip-flops to the logic that computes your output function to define the guts of the Control Unit box. Items (i) through (iv) need to be submitted on paper together with a printout of the final circuit for item (v) and any additional description of your circuit that you feel will be relevant for someone trying to understand your design. v) Integrate your circuit with the template circuit provided and submit the final design using the HW5 Dropbox in PUBLIC.

ii)

iii) iv)

Anda mungkin juga menyukai