Lab 7 - ECE 421L
Part 1 -- Using buses to create multiple-bit word inverters and other logic gates
First we will draft the schematic for a 4-bit inverter:
To start off, we use a basic inverter, create the symbol for it, then use buses to make a concise schematic for inverting a 4-bit word. The inverter is given the Instance name I0<3:0> because it will then have 4 inputs and 4 outputs, and the thick wire tool is used to draw the buses, as shown below:
Next we create a symbol that indicates the inverter is a 4-bit inverter:
Now we can simulate the operation of this 4-bit inverter, connecting certain outputs to different capacitive loads; this is done using the following circuit:
image
The simulation is as follows:
Clearly, the output best displays an inverted output with lower capacitances.
Now, we move on to the 8-bit inverter and logic NAND, NOR, AND, and OR gates:
To create the 8-bit inverter, we use the symbol created above and label its name as IO<7:0>. Then we use buses instead of wires so the inverter can take 8 inputs and give 8 outputs . The schematic looks like this:
The symbol we will use for the 8-bit inverter:
Now, we ensure the 8-bit inverter works by using a circuit with 8 pulse sources going from 0 to 5 V (logic zero to logic one). I have set the 8 inputs to change at .5 us to the following value: 01010101. Thus, the inverted output should be the inverse of that binary word, or 10101010.
The output of the 8-bit inverter with that input is shown below:
The results are good.
Next, we create 8-bit logic gates. We have already created the NAND and NOR gates in previous labs:
NAND: NOR:
Thus, to create the AND and OR gates, we just add an inverter to the output of the NAND and NOR gates:
AND: OR:
To create the 8-bit logic gates, we use buses as before:
NAND:
AND:
NOR:
OR:
Now we ensure the operation of these 8-bit logic gates by setting up a circuit like the following for each:
Each of the pulses I need to represent '1' I gave a 1us period, so that at .5 us they will switch to 5V, or logic 1. The inputs that needed to be '0' I gave a period of 4us so that they would not be switching to logic 1 until 2us. Then simulating for 1us will give the results for the two inputs I gave.
The two 8-bit words I chose will test all four possible cmobinations of inputs to the gates: 00, 01, 10, and 11. Let A = 10110011 and B = 10101010 (B is the same number used to sim the inverter.)
Since the truth tables for AND, NAND, OR, and NOR are as follows:
AB | A and B | A nand B | A or B | A nor B |
00 | 0 | 1 | 0 | 1 |
01 | 0 | 1 | 1 | 0 |
10 | 0 | 1 | 1 | 0 |
11 | 1 | 0 | 1 | 0 |
The results from my chosen values for A and B should be as follows (Least Significant Bit on the right):
A: | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
B: | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
A and B: | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
A nand B: | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 |
A or B: | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 |
A nor B: | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |