Lab 7 - EE 421L

Using buses and arrays in the design og word inverters, muxes, and high-speed adders

Authored by Isabella Paperno, paperi1@unlv.nevada.edu

Start date: 10/24/2023

Due date: 11/8/2023

   

Pre-lab work:

 

Lab description:

Using what we learned from the previous labs, this lab will have us combine those past devices (PMOS, NMOS, inverters, and NAND gates) to create the schematics, symbols, and layouts of a 4-bit word inverter, a 2-to-1 multiplexer (mux), and an 8-bit adder in Cadence.

     

Pre-lab completing Tutorial 5:

Through Tutorial 5, I learned about a ring oscillator and how to design, layout, and simulate one in Cadence.

   

Tutorial 5 started by copying the Tutorial 4 library to create the Tutorial 5 library, as we would use the inverter created from Tutorial 3, which was copied in Tutorial 4, to build the ring oscillator. Then a new schematic cell called ring_osc was created.

Copy Tutorial 4 to use for Tutorial 5  Create a new schematic called ring_osc

    

In this new schematic, we will create an instance of vdd and the inverter from Tutorial 3.    

Then we want to make 30 copies of this inverter (so 31 total inverters) and line them all up so the output of one inverter is the input for the next inverter.

Create 30 copies of the inverter   Line up the copies end-to-end

   

And we finish off the schematic by wiring the output of the last inverter to the input of the first inverter, creating a 31 inverter loop, and labeling that wire osc_out.

Wire the output of the last inverter to the input of the first inverter

Label the wire osc_out

   

Opening up ADE L, we make sure the MOSFET model libraries are attached then set the output osc_out to be plotted in a 200 ns transient analysis simulation.

Attach MOSFET model libraries   Simulation setup

   

When running this simulation, I noticed that the output plotted is pretty much just 2.5 V the entire time.

1st simulation attempt   

     

This is unlike a real circuit which would have noise causing oscillations from 0 V to 5 V (vdd!). To get that result we need to add an initial condition which can be found under Simulation -> Convergence Aids -> Initial Condition.

Directions on how to get to initial conditions

    

We select which node we want to initialize, in this case osc_out, and set it at 0. Doing this tells the simulation that our first input will be 0 V, leading it to produce a more realistic result.

Initializing osc_out to 0 V

   

Saving the simulation, with the initial condition, and running it again produces the following result. This is what we expect a ring oscillator to actually do, oscillate the voltage between 0 and vdd (5 V).

Simulation results with an intial condition

   

While this schematic works for a ring oscillator, it could also be created in a more condensed form.

    

Focusing back on the schematic, we want to delete all inverters except one. Then press the bindkey q to edit the object's name to I0<1:31>. This tells Cadence that the input and output of this device will have 31 bits coming in and out of it.

Remove all but 1 inverter and edit it's name

    

Due to having more than 1-bit input/output, we need to use wide wires (or buses) on the inverter. Then we can label the buses as osc_out,out<1:30> for the input and out<1:30>,osc_out for the output. We need to use this naming convention so we have all 31 bits going through the inverter but isolating the final output / initial input bit from the rest of them.

Create and label wide wires (buses)

This schematic is the exact same as the first one but just more condenced and easier to see. Simulating this one also gives the same results as above, with the initial condition set.   

     

Moving on to the layout, we start by placing 2 inverter layouts side-by-side. Then make it so their power and ground are connected together and connect the output of the left inverter to the input of the right inverter. The new connections can easily be seen if we change the display level to 0. We can also DRC this and see that we will have 0 errors using this connection.

Lay 2 inverters side-by-side and connect them together.   Showing the newly added connections on display level 0

DRC results of 2 connected inverters, 0 errors

     

Changing the display level back to 10, remove the right inverter. Now, similar to the schematic, we can copy this single inverter (with connections) 30 times so that we have 31 inverters all lined up in a row and receiving inputs from the previous inverter output.

Remove the right inverter so we have just 1 inverter with connections.   Copy the inverter 30 times and line them up side-by-side

      

The layout should then look like below and we can check for any errors with DRC.

Layout of 31 inverters all lined up

DRC of 31 inverters lined up, 0 errors

     

Now we need to add the connection between the final output and the first input. Instead of drawing a metal1 path to wrap around the entire layout, we can just make one metal2 layer (easier to see in display level 0) with m2_m1 connections at the desired locations. We can check with DRC for any errors due to misalignment or not properly connected metals.

Add m2_m1 connection to the input of the 1st inverter   Add m2_m1 connection to the output of the last inverter

Layout of ring oscillator, without pins

DRC results of the pinless layout, 0 errors

    

The last thing we need on this layout are the pins. We need 3 pins: an inputoutput pin for vdd!, an inputoutput pin for gnd!, and an output pin for osc_out. Then we can run our final DRC check. Once it returns with 0 errors, we know the layout is complete.

Completed layout with pins   DRC results of completed layout , 0 errors

    

With the layout complete, we can then extract it and run the LVS verification.

Extracted view of completed ring oscillator layout
1st LVS attempt, results in failure

The first time we run LVS we will get an error message that it failed to match. This failure is due to the osc_out output pin placed on the layout, as there is no output pin on the schematic.

    

This can easily be resolved by reopening the schematic and adding the osc_out output pin. However, the pin cannot be attached to the bus directly, instead a wire needs to come out of the bus and be labelled as the correct output name before connecting to the output pin.

Add osc_out pin to the schematic

    

Running LVS this time will give us a match.

LVS match

    

Now that we have a working schematic and layout we can compare them with simulations.

   

For a simulation though, we should use a symbol. But we can't do that right now due to the vdd symbol in our schematic, so we need to remove that then create our symbol.

Ring oscillator schematic with vdd removed   Ring oscillator symbol

    

Then we need to copy all the ring_osc cells into a new cell view, specifically for the simulations, called sim_ring_osc.

Opening that schematic, we can delete everything and place just vdd, the ring_osc symbol, and a wire for the osc_out output. To prevent the floating net warning I also added a noConn instance to the end of the osc_out wire.

Ring oscillator simulation schematic    

    

Launching ADE L, we need to set up the simulation by setting the model libraries, setting a transient analysis for 200 ns, selecting to plot osc_out, and setting an initial condition of 0 on osc_out.

Simulation set up

    

After setting it up, we can save then run the simulation to get the following result. This is exactly what we expect from a ring oscillator and what we saw it do earlier before we created the layout.

Ring oscillator schematic simulation results

     

We can then view the results of the extracted view by going to Setup -> Environment and enter extracted before schematic. This will also give the same, correct, results as above.

Changing the environment to extracted

Ring oscillator extracted simulation results

     

This concludes the pre-lab section, all work completed in the pre-lab can be found in Tutorial_5_Lab_7.zip

   

   

Lab procedures:

   

Creation and simulation of a 4-bit word 6u/0.6u inverter:  

To prepare for the 4-bit word inverter, I need to first create a 6u/6u inverter. I quickly copy the inverter schematic from lab 6 and change it so both the PMOS and NMOS are 6u/0.6u in size.

6u/0.6u inverter schematic

     

Then I can create a symbol from this schematic.

6u/0.6u inverter symbol

     

Using that symbol, I can create a new cell view to draw the schematic for a 4-bit word inverter, placing 4 inverter symbols within. I start by drawing the expanded view as to understand what I am doing: obtaining 4 inputs and getting 4 outputs.

Expanded schematic for 4-bit word inverter

    

Now knowing exactly what I am making, I can simplify this down to use just 1 inverter with a 4-bit bus. I remove all but one inverter and change the names of the inverter and pins to include <3:0>, denoting there will be 4-bits running through them. 

Remove all but one inverter and include <3:0> in all instance names

     

Saving that provides this finalized, condensed, 4-bit word inverter.

Condensed 4-bit word inverter schematic

     

And the symbol for this schematic would look very similar but is labeled as X4 to denote that there are actually 4 inverters within this one symbol.

4-bit word inverter symbol

     

With this symbol, I can create a simulation schematic like the one seen on the lab 7 webpage. In this schematic, all 4 inputs are tied together as in to the input pulse. Then the output is a 4-bit bus but each bit is singled out to be connected to a different load: 100fF for out<3>, 500fF for out<2>, 1pF for out<1>, and no load for out<0>

4-bit word inverter simulation schematic

     

For the schematic, we want to plot the tied input and each of the individual output values for 50 ns in a transient analysis.

4-bit word inverter simulation setup

     

Saving and running the simulation provides the following results where we can observe how different capacitive loads affect the output voltage.

4-bit inverter simulation results

Through these results we can see that a having no load (out<0>) barely affects the rise/fall times of the output and allows the output to switch near instantaneously. However, when we add capacitive loads it appears that there is a sweet spot or a certain range the capacitor can be in to get a similar result. With a small load like 1pF (out<1>), there appears to be a ~4 ns delay—on top of the 1 ns rise/fall time—before the output stabalizes after the input switches. With a large load like 500fF (out<2>), there is less delay, ~2 ns, before the output stabalizes after the input switches. However, with the 100fF load (out<3>), the delay looks to be ~0.5 ns on top of the 1 ns rise/fall time, making it much closer to the results with no load than any of the other tested loads.

   

   

Creation of an 8-bit 6u/0.6u NAND gate: 

To begin creating the 8-input NAND gate, I need to copy the 2-input NAND gate from lab 6 into my lab 7 directory. This makes it easier as the NAND gate schematic and symbol are already created and can be easily modified.

schematic of a 2-input 6u/6u NAND gate   symbol of a 2-input 6u/6u NAND gate

      

Then I can copy this 2-input NAND gate to start creating my 8-input NAND gate. For the schematic, I remove everything and just attach the 2-input NAND gate symbol to input pins A and B and output pin AnandB. I then change all the instance names to include <7:0>, denoting that 8-bits will be moving through this device.

schematic of 8-input 6u/6u NAND gate

    

From this schematic, I can create the symbol for my 8-input 6u/6u NAND gate, making sure to note that all the pins are 8-bits.

symbol for 8-input 6u/6u NAND gate

     

   

Creation of an 8-bit 6u/0.6u NOR gate:  

Moving on to the NOR gate, I notice this is just the opposite of the NAND gate. I start by creating the 2-input version, copying the 2-input NAND gate and rearrang it so the NMOS transistors are in parallel beneath the series of PMOS transistors. I also create the symbol for this 2-input version to be used later with the 8-input version.

schematic for a 2-input NOR gate   symbol for 2-input NOR gate

   

Now, I can create the 8-input 6u/6u NOR gate. I start by copying this 2-input version as the 8-input version (as to reuse and modify the schematic) and remove everything except the pins. I then add the 2-input NOR device and connect it to the pins using buses, making sure to change all the instances to include <7:0> in their names denoting the 8-bit input.

schematic for 8-input 6u/6u NOR gate

    

Opening the symbol, I edit the note of the 2-input NOR gate to read 8-input NOR gate and change the instance names to also include <7:0>.

symbol for 8-input NOR gate

   

   

Creation of an 8-bit 6u/0.6u Inverter:  

Next up, I created the 8-input inverter as this will be used in the AND and OR gates. I started by copying the 4-bit word, created earlier in this lab, and editing it to be 8-bits in length instead of 4-bits.

copy 4-bit word inverter for the 8-input inverter   schematic for 8-input 6u/6u inverter

     

I also edit the symbol note to read X8 instead of X4 to indicate that there are 8-inputs (or essentially 8 inverters) being read by this device.

symbol for 8-input inverter

    

   

Creation of an 8-bit 6u/0.6u AND gate 

For the AND gate, no 2-input version was necessary. Instead the 8-input NAND gate and 8-input inverter were put together to form the 8-input AND gate. This method works as the inversion of the NAND gate gets canceled out by the inverter, leaving just the AND result.

schematic for 8-input AND gate

   

Then the symbol was completed by copying the NAND symbol and removing the circle.

symbol for 8-input NAND gate

    

   

Creation of an 8-bit 6u/0.6u OR gate:  

Similar to the 8-input AND gate, the 8-input OR gate also just used the 8-input NOR gate tied with the 8-input inverter. And it's symbol, again, was taking the NOR gate and removing the circle.
schematic for the 8-input OR gate
   
symbol for the 8-input OR gate

     

     

Simulation of the 8-bit NAND, NOR, AND, Inverter, and OR gates:  

Finally, with all the 8-input devices completed, I can quickly simulate them all at once. I first started by creating the simulation schematic which lined all the 8-input devices—inverter, NAND, AND, NOR, and OR—in parallel, all connected to input A which had a 40 ns period (pulsing every 20 ns) and input B which had a 20 ns period (pulsing every 10 ns) and tied to their own outputs. When saving and checking, I ran into warnings about bits <7:1> of each device counting as dangling wires but those were safe to ignore for the purpose of this simulation.
simulation schematic of all 8-input devices
     
For the simulation setup, I selected to plot both inputs (A and B) as well as each of the final outputs (bit 0) of each device, running for a 40 ns transient analysis.
simulation setup for all 8-input devices
   
Saving and running this simulation produced the results seen in the graph below. Comparing these values to the expected values (seen in the table below), we can see that everything is working properly.
transient simulation results of all 8-input devices  
ABAiAnandBAandBAnorBAorB
0011010
0111001
1001001
1100101
     

   

Creation and simulation of a 2-to-1 DEMUX/MUX:  

Creating the schematic and symbol of the 2-to-1 DEMUX/MUX was simple. I just followed the examples given on the lab 7 webpage to get them correct, as seen below.
schematic for 2-to-1 DEMUX/MUX    
symbol for 2-to-1 DEMUX/MUX
     
However, simulating them was something else. I started by just simulating a 2-to-1 MUX. I created a new cell view and removed everything, then copied vdd and the A and B voltage sources from the simulation for all the 8-input devices. I made one more copy of the voltage source and adjusted it so it can act as S then connected that to an inverter to get Si.
simulation schematic for 2-to-1 MUX
   
For the simulation itself, I chose to plot all the inputs (S, Si, A, and B) as well as the output Z for an 80 ns transient analysis.
simulation set up for 2-to-1 MUX
   
Saving and running the simulation provided the following results.
Transient Response for 2-to-1 MUX simulation

     

Normally, the Mux would be dependent on S to select which input to direct to the output. However, this schematic is supplying Si to the body of the PMOS transistors while S is being fed to the bodies of the NMOS transistors leading to Z to be found with the following equation: Z = A*S + B*Si. This means that whenever Si is 1, the input B would be fed to the output but whenever S is 1, the input A would be fed to the output which is kinda the opposite of what a normal Mux with just S would do. The expected values using this output equation can be found in the table below, which match the outputs received in the simulation.   

SSiABZ
01000
01011
01100
01111
10000
10010
10101
10111
     
Simulating the DEMUX is very similar to simulating a MUX. The only difference is that for a MUX, there are multiple inputs being fed to one output and the select lines decides which input to drive through but for a DEMUX, there are multiple outputs trying to receive one input and the select lines decide which output to send the input to. Essentially, a DEMUX is a reverse MUX.
Instead of just editing the MUX simulation, I copied it into a separate simulation for the DEMUX. I then moved the B input voltage source to become the input voltage source for Z and made A and B the outputs by connecting them to noConn instances.
simulation schematic for a 2-to-1 DEMUX
     
The simulation setup was pretty much the same as for the MUX, however I rearranged the nets to be plotted so the input Z would be seen before the outputs A and B.
simulation set up for 2-to-1 DEMUX
   
Saving and running this simulation then provides the following results.
Transient results for 2-to-1 DEMUX simulation
   
Just like with the Mux, the Demux would normally be dependent on
S to select which output to connect to. However, this schematic is supplying Si to the body of the PMOS transistors while S is being fed to the bodies of the NMOS transistors leading the outputs to be found by the following equations: A = Z*S and B = Z*Si. This means that whenever Si is 1, the Z would connect directly to output B but whenever S is 1, then Z would connect directly to output A which is the opposite of what a normal Demux with just S would do. The expected values using these output equations can be found in the table below and match the results obtained from the simulation.
SSiZAB
010x0
011x1
1000x
1011x
   

    

Creation and simulation of a 8-bit wide word 2-to-1 DEMUX/MUX:  

Creating an 8-bit wide word 2-to-1 DEMUX/MUX was simple. However, I first built a schematic using the 2-to-1 DEMUX/MUX created above and edited it so the 8-bit MUX would only have one select line. This was done by removing the Si input but still generating the Si net using an inverter from the S input. Since this is a DEMUX/MUX I also changed AB, and Z to be inputoutput pins as either could be the input or output depending on whether the device is used as a MUX or DEMUX.

schematic for an 8-bit 2-to-1 DEMUX/MUX

    

The symbol for this 2-to-1 DEMUX/MUX then appeared more like the ones we learned of in CPE100, using just one select line.

symbol for 2-to-1 DEMUX/MUX with just one select line

    

Moving on to the 8-bit version, I used this new single-select 2-to-1 DEMUX/MUX and attached 8-bit buses to the inputs and outputs. Then the symbol for this is the same as the single-select 2-to-1 DEMUX/MUX but just labeled differently to indicate it is the 8-bit version.

schematic of 8-bit 2-to-1 DEMUX/MUX symbol of 8-bit 2-to-1 DEMUX/MUX

   

To ensure this 8-bit version was built correctly, I simulated it, starting with the MUX again. The simulation set up was the same as above but removing Si from outputs to plot and including Z<0>, providing the same results as with the single-bit version.

simulation schematic for 8-bit 2-to-1 MUX  
Transient results of 8-bit 2-to-1 MUX

    

Moving on the the DEMUX simulation, again, the simulation set up was the same as above but removing Si from outputs to plot and including A<0> and B<0> to be plotted, providing the same results as with the single-bit version.

simulation schematic for 8-bit 2-to-1 DEMUX  
Transient results for 8-bit 2-to-1 DEMUX simulation

    

   

Creation and simulation of a Full-Adder: 

To begin creating the full-adder, I create an entirely new cell veiw schematic and recreate the schematics seen in Fig. 12.20 using 6u/0.6u devices.

full-adder schematic as seen in Fig. 12.20

   

Then I copied the shape of the symbol from the full-adder created in lab 6, making sure that the pins were matching what was used in the schematic above.

full-adder symbol

    

To create the 8-bit adder, I created a new schematic that used the above full-adder symbol and attached pins to it using 8-bit buses.

schematic for 8-bit adder

    

The symbol was, again, the same as the full-adder but the text was modified to indicate this was the 8-bit version.

symbol for 8-bit adder

    

Using this symbol, I began creating a schematic for simulations. I actually copied the full-adder simulation used in lab 6 and just changed the full adder used there to this newly created 8-bit full adder.

simulation schematic for 8-bit full adder

    

The simulation results can then be compared to the table below to confirm the 8-bit full adder was built correctly.

transient results for 8-bit adder simulation

ABCSC1
00000
00110
01010
01101
10010
10101
11001
11111

   

And with this sucessful simulation I can move on to creating the layout.

   

All my work for lab 7 can be found in two zip files. Work from the prelab can be found in Tutorial_5_Lab_7.zip while the lab 7 work can be found in lab7_Cadence_IP.zip

     

   

Conclusion:
In this lab, I learned about buses and how to use them to provide 8-bits to devices.
     
Backing Up Lab Work:
zipping up my lab work sending zipped work to myself through email
  

     

     

Return to EE421L Lab listings