What the laboratory asks for, what the hardware does, and the order to do the work in. Ten minutes of reading.
A four-bit signed adder and subtractor, built, simulated and brought with you.
Two ASM designs, then an ALU built around them.
The five stages of Laboratory 1, run twice, once for the signed multiplier and once for the signed divider. Each gets its own pseudocode, chart, datapath, detailed chart and control logic.
Then the ALU around them, which is where the points that are easy to miss live.
OperationSelect[1..0] chooses what reaches MuxOut[7..0], in the pairing Table 4 of the handout gives.CarryOut, ZeroOut and OverflowOut, all three brought out of the ALU.CLK100MHZ multiplexes them in time, driving seg[6..0] and an[7..0].A report that shows a working display and skips the charts loses most of the marks.
A four-bit arithmetic logic unit for signed numbers. It takes two four-bit operands and a two-bit operation select, performs one of four operations on them, and shows the result on the board's seven-segment display.
| OperationSelect | Result on MuxOut[7..0] | Where it comes from |
|---|---|---|
| 00 | four-bit sum | the pre-lab adder |
| 01 | four-bit difference | the pre-lab subtractor |
| 10 | eight-bit product | the multiplier you design |
| 11 | four-bit quotient and remainder | the divider you design |
Three status lights come out alongside the result: CarryOut for a carry or borrow, ZeroOut when the result is zero, and OverflowOut when the operation overflowed.
The operands are signed, and the handout closes the easy route explicitly. You may not detect a negative operand, flip it positive, multiply or divide, and fix the sign afterwards. The multiplier and the divider have to handle signed values directly. That single sentence is what makes this laboratory harder than it looks.
Lecture 6 is the one worked example in the course of all five ASM stages on a single problem. Its subject is a floating point adder, which is not the arithmetic of this laboratory, so take the method from it and not the mathematics: how the pseudocode became a chart, how the chart produced a datapath, and how the detailed chart produced the control logic. Laboratory 2 asks for that sequence twice over.
Lecture 8 is the closest to the work itself, carrying multiplication, division and signed multiplication and division, along with the carry lookahead adder that the bonus asks for. Lecture 7 covers signed and unsigned numbers, addition and subtraction, and arithmetic overflow, which is the pre-lab and the OverflowOut status signal.
| Board | Digilent Nexys A7-100T, Xilinx Artix-7 |
| Software | Xilinx Vivado, Windows or Linux x86 only |
| Arithmetic | four bits, so the result fits the seven-segment display |
| Team | two people |
| Due | Wednesday 14 October, midnight, Brightspace |
GClock is a push button. Laboratory 1 divided the 100 MHz clock down to about one step per second, and here you supply each edge yourself. Here you step the circuit by hand, and the Nexys A7 buttons are active high and not debounced, so one press can register as several edges. The multiplier and the divider each need a fixed number of steps before the answer is valid, so press deliberately and count.
CLK100MHZ is still there, and it drives the display only. The seven-segment digits share one set of cathodes, so a supplied display controller refreshes them in turn from the oscillator. It is not the clock your arithmetic runs on.
Four arithmetic units, one output multiplexer and a display controller.
Because the multiplier and divider take several steps, each needs a Done state, and the result is only valid once it is reached. That is a difference from Laboratory 1, where every step produced a finished answer.
GReset forces every flip flop in the design to a known value, so the circuit starts from a defined state. The fabric powers up in an arbitrary one. It reaches every functional block, and section 8 requires that.
Like GClock it is a push button on the board, so the demonstration starts by pressing reset and then stepping.
Five bonus marks are on offer. Replace the ripple carry adder with a four-bit carry lookahead adder. The handout asks for the modifications discussed, with no need to redraw every component, and the new design demonstrated to the teaching assistant. Section 5.4.1 of the textbook covers the design.
The pre-lab comes first and it is a gate. It has to exist, simulate correctly and be explained before the session begins, so it is the first thing to build, whatever order the report ends up in.
Then the two algorithms, on paper, before any VHDL. Signed multiplication and signed division are where the thinking is, and the ban on converting to positive first is the constraint that shapes both. Work them as pseudocode until you can run them by hand on a negative operand.
Then the ASM stages for each unit, in order. Chart, datapath, detailed chart, control logic. Each reads its input off the one before it, so a wrong chart costs everything after it.
Then the VHDL, from the bottom up, testing each block on its own before wiring it into the next. The adder from the pre-lab is already done and tested, which is a working foundation for the other three.
Integration last, then the output multiplexer, then the board.
The structure is fixed by the report guidelines: cover page, objectives, problem and solution discussion, verification, lab discussion, conclusion and appendices. The marking scheme puts the weight on the algorithmic solution, the components, the simulation and the demonstration.
Twenty five pages maximum, including cover page, contents and appendices, losing a mark for every page over. With two full ASM designs to present, this binds on Laboratory 2 in a way it did not on Laboratory 1.