2. Describe switching functions - A one bit full adder produces
a sum and carry out given two bits and a carry in. Complete the following:
3. Simplify function - Use Karnaugh mappings and/or algebraic
methods to derive a simplified function.
sumi(xi, yi, cini) =
couti(xi, yi, cini) =4. VHDL description - Implement the simplified functions in VHDL.
| ENTITY fulladd IS
PORT (xi, yi, cini : IN BIT; sumi, couti : OUT BIT); END fulladd; ARCHITECTURE behavioral OF fulladd IS
|


The hierarchical block diagram above should help in translating to
VHDL, such as determining what are the inputs, outputs, and internal signals.
An example can help. The following computes:
cin210 1 110
x210 101 5
+y210 = +111 = +7
cout2 sum210 1 100 12
| ENTITY fulladd3 IS
PORT ( x2, x1, x0 : IN BIT; y2, y1, y0 : IN BIT; sum3, sum2, sum1, sum0 : OUT BIT); -- cout is renamed sum3 to allow grouping END fulladd3; -- in simulator. ARCHITECTURE structural OF fulladd3 IS
|
Testing:The port mapping for adding bits 0 using the one bit full adder could be:U0 : fulladd PORT MAP(x0, y0, c0, sum0, c1);
The 3-bit adder can be tested by simulation as in Homework 3. Group x2, x1, x0; y2, y1, y0; and s3, s2, s1, s0 as below. Given that there are 64 different additions possible, it is not necessary to simulate exhaustively.
and
output from the adder (the sum of the switch inputs) can be displayed
on the 7-segment LED using Homework 4. The block diagram is at right.
Inputs: x210
and y210.
Outputs: The sum is a 4 bit result (0000-1110).
To display the 4 bit result on an LED
requires controlling each LED segment.
Signals: Internal signals
is the sum3210 bits output by the 3-bit adder and input by
the 7-segment display.
VHDL: A corresponding VHDL
ENTITY and ARCHITECTURE definition is:
| ENTITY fulladd7 IS
PORT ( x2, x1, x0 : IN BIT; y2, y1, y0 : IN BIT; a, b, c, d, e, f, g : OUT BIT); END fulladd7; ARCHITECTURE structural OF fulladd7 IS
COMPONENT segment7
|
Program the UP1 as in Homework 4. Use the same LED pin assignments for a-g segments. For input of x210 and y210 use any 6 pins near the MAX-SW1 rocker switches (e.g. 34-36 and 50-52). Test using some of the same values from the earlier simulation.
Part 1 - Design (complete truth table and simplified function) and implement in VHDL or graphically a 1-bit full adder. The adder output should be a sum bit and the carry out bit. The design should be simulated only.TURN INPart 2 - Design and implement in VHDL or graphically a 3-bit full adder. The adder output should be four bits consisting of the three sum bits and the final carry out bit. The design should be simulated.
Part 3 - Implement the 3-bit full adder of Part 2 on the UP1. The implementation should input two 3-bit binary numbers from six switches and output the 4-bit result to a 7-segment display.