Instruction
project for digital circuits class ECE171
the project should be in the end in file document with the codes used
in the attachment is the test bench and the description of the project
User_8160 added on 11/27/15 at 05:23 AM (PST):
hi .. i will upload the project file with the test bench code that you need to use in the project
the final should be in a document for me to submit it along with the codes
User_8160 added on 11/27/15 at 05:27 AM (PST):
i uploaded the wrong test bench code.. i added the new one .. its named new test bench
User_8160 added on 11/27/15 at 05:28 AM (PST):
here is what the instructor sent to us
Some hints:
The admonishment to do a black box is for real think about what the inputs are, for example, for each block or module from your IsZero module to your DivisiblyByFour module, to the final LeapYear module.
For the DivisibleByFour module look for patterns in the *decimal* numbers from 00 to 99. Specifically, look at the least significant *digit*. Obviously no two digit number whose least significant digit is odd can possibly be divisible by four. But depending upon the least significant digit (e.g. 2 or 4) the number may or may not be divisibly by four depending upon the most significant *digit*. So, for example, 12 is divisible by 4 but 14 is not, though 64 is. Use K-maps not for the entire truth table of 8 bits (2 BCD digits x 4 bits), but for the subset of bits needed.
Small point, but when naming your input/output ports for building blocks use general names (not application specific names). Thus, while you *may* use your DivisibleByFour module in a higher level LeapYear module, DivisibleByFour simple looks at ANY two-digit BCD number and tell us whether its divisible by four. So its inputs dont have to be years or tens of years. Now, when you instantiate it the module in the context of your LeapYear module you can certainly name the wires you connect to its ports things like YT or YO (YearsTen, YearsOne). Same with IsZero. It takes *any* single digit BCD input and indicates whether its zero or not.
Dont think of the top level module in terms of a truth table but rather a construction of lower level modules (based on the definition of a leap year given in the assignment).
Finally theres no reason to make a mistake in your final submission. You should submit before the deadline then DOWNLOAD your own submission and unzip it, remake, re-run it to ensure everything is there. If you messed up or zipped the wrong file, you can re-submit and it will overwrite your earlier submission.
User_8160 added on 11/27/15 at 05:29 AM (PST):
Also, remember that in data flow, in addition to instantiating other modules, you can only use assign statements. If you wanted to say something like:
if (a)
s = x;
else
s = y;
youd instead say:
assign s = a & x | ~a & y;
or using our friendly ternary operator:
assign s = (a) ? x : y;
User_8160 added on 11/27/15 at 05:31 AM (PST):
please let me know if you have any question