Vhdl Program For 2 Bit Alu

2020. 3. 2. 14:42카테고리 없음

ALU designALU designI. IntroductionIn this lab you are basically building a 2-bit ALU.

You are required towrite a behavioral description of an ALU. Note: when constructing theALU, do not use LE's, AE's, and FA's as shown in the book. All youreally need are case statements, etc. The ALU should take in two2-bit numbers and have the following functionality:. Add the numbers.

Subtract the numbers. NOR the numbers. NAND the numbersThe output of the ALU will consist of one 2-bit result and acarry/borrow bit.

You are also required to write a testbench forthis design. You will have to feed values into your design anddemonstrate that it is correct by simulating your desgin usingALDEC Active-VHDL (using the testbench you wrote) and thendownloading the design unto an XS40 board.II. ProcedureImplementing and simulating the design.

Vhdl code for 4 bit alu

Run Active VHDL by clicking on the icon on the desktop.If a window pops up regarding evaluation terms, clickon 'I Agree'. Create a new design and store in in C:temp. Select 'Add existing resource files' if you have already typedup your vhdl, otherwise select 'Create new source files now'.

32 Bit Alu Vhdl

Once you have gotten you files loaded and compiled into ActiveVHDL, select Simulation-Initialize Simulation. (If youdo not remember how to load and compile files go back tothe Aldec tutorial).

Click on the small button next to the save icon to create a newwaveform. Select 'Waveform-Add Signals' and add all the signals in yourtestbench.

Vhdl Code For 8 Bit Alu Using Behavioral Modeling

Push the 'Run' button and see if the output is what you hoped itwould be.Download VHDL. After you have verified the results using ALDEC, check out anXS40 board from the T.A. To download your code and verifyyour results. To view the results of your ALU on the XS40 board, youwill need to connect the ALU to the decoder you previouslydesigned.

Below is a schematic showing how this couldbe done. There are several things you should keep inmind when modifying your code for download:. The ALU outputs a 2-bit number, the 7-segmentdecoder takes a 4-bit number as intput.

Thisneeds to be remedied when connecting the twocomponents. You should ignore the carry/overflow bit whendownloading. A.ucf file needs to be created so that the inputsand outputs of your design are connectedto the desired pins, you can look at previous.ucf files to get an idea of how this mightbe done. Load your modified design into Xilinx and generate abit file (if you do not remember how to do thisgo back to the Xlinix synthesis tutorial). Load your bit file onto to the XS40 board and testyour ALU.

VHDL Tutorial: Learn by ExampleVHDLTutorial: Learn by Example-by Weijun Zhang, July 2001. NEW (2010): See the new book, F. Wiley and Sons, 2007. Concise (180 pages), numerous examples, low-cost.