Lab 5 - FL13 - ECE 198 JL - University of Illinois - Engineering Wiki

If we arrange cout and s as two bits of an uns igned

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a, b , and c arry -in (Cin). It als o has two output bits : the s um (s ) and the c arry out (Cout). If we arrange Cout and s as two bits of an uns igned binary number, then this binary number tells us how many 1s are in the inputs . For ex ample in the fourth row of the truth table, < a,b ,Cin> = < 0,1,1> , s o < Cout,s > = < 1,0> or 2 in dec imal. Similarly in the fifth row of the truth table, < a,b ,Cin> = < 1,0,0> , s o < Cout,s > = < 0,1> or 1 in dec imal. a b Cin Cout s 000 0 0 001 0 1 010 0 1 011 1 0 100 0 1 101 1 0 110 1 0 111 1 1 As y ou may rec all from the beginning of this lab, the XOR func tion is an odd/even detec tor. If y ou look at the s um bit of the full adder, s is 1 when there are an odd number of 1s in the inputs . W e build a c irc uit that c omputes the s um bit (s ) by c omputing the func tion s = a XOR b XOR Cin. In the following direc tions , we s how y ou how to implement the s um bit (s ) and then als o s how y ou how to implement Cout. There is a bug in the implementation of Cout, that y ou will need to find and c orrec t by us ing the tec hniques that we s howed y ou when y ou were building the my _x or c irc uit. What to do 1. Create a new bloc k diagram with the des ign unit name Full Adder. 2. Add y our my _x or c irc uit to y our s c hematic . Clic k Add and then Com pone nt to open the c omponent brows er. Ideally y ou s hould s ee the lab5_lib in y our c omponent brows er. If not, c lic k the Add libra ry button in the top left to add the lab5_lib. Clic k and drag my _x or onto y our s c hematic . You c an res iz e the c omponent, move tex t, and move ports by c lic k ing and dragging. Note: You c an c hange the appearanc e s o y our gate look s lik e an XOR if y ou want under the s hapes menu. Onc e y ou have res haped y our XOR gate, c opy and pas te it to mak e another one. 3. Des ign the res t of y our s c hematic . Add ports , gates , and wires to y our s c hematic to des ign the following c irc uit 4. Tes t and debug y our full adder. Save and c los e the s c hematic and open y our full adder c irc uit in models im. Des ign a tes t s equenc e for the full adder whic h will help allow y ou to tes t whether the full adder c irc uit behaves c orrec tly . Compare y our waveform with the truth table for the full adder to find the error, c orrec t it and c reate a new s imulation that s hows the c orrec t behavior for the full adder. What to tur n in 1. Label the s c hematic bloc k diagram with y our name, netid, dis c us s ion s ec tion, and projec t name. 2. Print a. the s c hematic s b. .do file y ou us ed for s imulation, and c . the s imulated waveform 3. Staple them together, and turn it in Friday ’s lec ture. This w ill constitute your La b 5 subm ission. Do not s ubmit lab5 folder to s vn. To print, you m ust be pre se nt in a n EW S la b (DCL 440 for insta nce ). To print the s c hematic s of y our Full Adder c irc uit, c hoos e File -> Print from the menu in Bloc k Diagram window. In the window that pops up, edit the...
View Full Document

This document was uploaded on 03/22/2014.

Ask a homework question - tutors are online