136 views

Uploaded by Anh Trai Em Ốc

reference to 8 bit sequential multiplier

- DIGLAB3 - Design of Modulo Counters Aug 28
- Fpga Hardware Design
- Vhdl Lecture Notes - Navabi
- 8-Bit Array Multiplier
- 74HC4040
- Paper 10
- VHDL
- floating point multiplier
- AYADAV
- Data Sheet
- An 8 Bit Multiplier project report
- Ecad & Vlsi Lab(3)
- Lab 1
- Code
- Digital Lab Datasheets Final
- 2A03 Technical Reference
- COUNTERS.doc
- PWM Algorithm
- 4097450.pdf
- h 0353044049

You are on page 1of 6

Learning Goal: A Simple VHDL Design. Requirements: FPGA4U Board. Quartus II Web Edition and ModelSim-Altera.

1 Introduction

As a reintroduction to VHDL, you will implement a sequential multiplier using the Shift-and-Add algorithm.

2 Binary multiplication

Example of a 4-bit unsigned multiplication (11 9 = 99): Multiplicand Multiplier 1011 1001 1011 0000 0000 + 1011 01100011

Product

The next gure is the generic entity of a combinatorial multiplier. Notice that the output bitwidth is the sum of the bitwidth of each input operand.

n n

A B

Multiplier

2n

3 Sequential multiplier

A sequential multiplier requires some additional signals for synchronization purpose. Input clk: clock signal to synchronize the system. Input reset: asynchronous reset signal to initialize the system. Input start: synchronous signal that must be high to start a new operation.

Version 1.14 of 23rd August 2012, EPFL 2012 1 of 6

Output done: synchronous signal that is set during 1 cycle by the multiplier when the result of the operation is available.

n n

reset start A B

Multiplier

done P

2n

To implement the sequential multiplier, we will use the Shift-and-Add algorithm. This algorithm is inspired from the multiplication method you learned at school: you sequentially multiply the multiplicand (operand B in the gure) by each digit of the multiplier (operand A in the gure), adding the intermediate results to the properly shifted nal result. The following gure describes the architecture of the multiplier.

A

8

B

8

datain dataout

multiplier(0) 8

clk load

datain

Multiplicand

dataout

multiplicand(7..0)

done

product_in(16..8) 9

datain

dataout

product(15..8) 16

done

The components description is listed below. The 8-bit register Multiplicand: Operand B is loaded when load is high. The 8-bit shift-register Multiplier: Operand A is loaded when load is high. It shifts to the right when shift right is high. The dataout output is the least signicant bit of the register. The 17-bit shift-register Product: Its initialized to 0 when reset is high.

2 of 6 Version 1.14 of 23rd August 2012, EPFL 2012

It loads the Add result in its most signicant bits when load is high. It shifts to the right when shift is high. The dataout output bits are its 16 least signicant bits. The AND gates: It performs the AND logical operation on each Multiplicand bits with the least signicant bit of the Multiplier. The 8-bit Adder: It adds the result of the AND gates with the 8 most signicant bits of the Product output. The system Controller: It contains a state machine, and it sets the control signals of all the components.

4 State machine

The controller contains the following state machine. It includes a 3-bit saturating counter used to count the 8 steps of the addition algorithm.

/start -

reset done

s0

start init

s3

s1

s2

load_product counter++

The reset signal resets the state machine to state S0. State S0: We wait until the start signal is active on the rising edge of the clock before going into state S1 and initializing the registers where: The Multiplicand and Multiplier registers load the input values. The Product register and the loop counter are initialized to 0. State S1: The next state is always S2. The ALU result is loaded in the Product register.

Version 1.14 of 23rd August 2012, EPFL 2012 3 of 6

The loop counter is incremented. State S2: If the loop counter saturates (overow after an increment) we continue to state S3, otherwise we return to state S1. In each cases, the Multiplier and the Product registers are shifted. State S3: The Multiplication is complete and the next state is S0. The done signal is set.

5 Exercise

Download the project template. In the quartus folder you will nd the Quartus project. Open it and take a look at the muliplier_8bits.bdf schematic le. The structure of the system is already given. For the start and reset signals we are going to use the push buttons of the FPGA4U. These buttons send a a logical 0 when they are pressed and a logical 1 when there are released. We want the opposite behavior on those buttons. In the schematic le, inverters have been placed on the reset n and start n inputs. From the schematic le, you can edit the VHDL code of any instance by double clicking on it. You can also open project les from the Project Navigator in the File tab.

Complete the VHDL code for the registers and the combinatorial circuits (i.e., every module except the Controller). Simulate each component separately in ModelSim. For the simulations, create a Modelsim project in the modelsim folder. Add each VHDL le to it. Compile, correct potential errors, and start the simulations. Some simulation scripts (i.e., *.do les) are already present in the modelsim folder. You are free to modify them or create new ones.

ModelSim does not support the *.bdf le format. To simulate the entire system, you should convert the schematic le to VHDL: Open the muliplier_8bits.bdf schematic le. In the menu, select File > Create / Update > Create HDL Design File for Current File. Click OK. This will generate a multiplier_8bits.vhd le in your quartus folder. Move it into your vhdl folder, and add it to your ModelSim project. Complete the Controller VHDL code. Simulate the entire system and verify that its behavior is correct.

4 of 6 Version 1.14 of 23rd August 2012, EPFL 2012

If the design works properly in the simulation, you are ready to download the design onto the board. The pin assignment is already set. Return to Quartus. Compile the project. It may happen that Quartus sees errors and warnings that ModelSim ignores (like when a signal is set in two or more processes). In that case, correct all new errors until compilation is successful, and simulate again with ModelSim, if necessary. Plug your FPGA4U board. Open the Programmer and download the design onto the FPGA.

7 6 5 4 3 2 1 15 14 13 12 11 10 9

0 8

start_n done

reset_n

The clock signal has a frequency of 24MHz. Multiplication takes less than 20 cycles and therefore is done in less than 1s. The steps of the multiplication happen too fast for you to observe something with your eyes.

Here, you implement a simple clock divider to slow down the execution of the multiplier so that you can observe each step of the multiplication. An easy way to divide the clock signal frequency is to use a counter. Each counter bit pulses at the clock frequency divided by a power of 2: the bit 0 of the counter will pulse at half the frequency of the input clock, bit 1 at half the frequency of bit 0, bit 2 at half the frequency of bit 1, etc. The following timing diagram gives an example of a 3-bit counter.

0 1 2 3 4 5 6 7 8

5 of 6

Knowing that the counter is clocked at 24MHz. Find the counter bitwidth needed to achieve approximately one pulse per second on its most signicant bit. Implement the counter in a new VHDL le. It will take the system clock as input and the most signicant bit of the counter as output. Generate the counter Symbol File and add it in your system to look like the following gure. Compile, download the new design onto your board, and observe the result.

We now want to design a combinational multiplier that have the same specications as the mul instruction in nios 2, except that we chose to use 8 bits instead of 32 and add an overow signal: Input A: 8 bits unsigned integer. Input B: 8 bits unsigned integer. Output P: 8 bits product of the multiplication of A by B. Output overow: signal whos high when an overow has been detected. Implement a structural combinational multiplier in Combinational_MultCell.vhd. First, in VHDL, implement a unit containing the logical AND gates and the adder. Then, in Combinational_Multiplier.vhd, add 8 instances of this unit (using the example in comment), and connect them in a chain. Finally, connect the overow signal. Notice that there is an overow signal because the product has the same bitwidth than the inputs.

MultCell

Z B An

8 8

R0

n n

A B

Multiplier

R8..1

overflow

6 Submission

Submit all vhdl les related to the exercise in sections 5.1, 5.2 and 5.5 (Multiplier_8bits.vhd, Add.vhd, And1x8.vhd, Controller.vhd, Multiplicand.vhd, Multiplier.vhd, Product.vhd, Combinational_MultCell.vhd and Combinational_Multiplier.vhd)

6 of 6

- DIGLAB3 - Design of Modulo Counters Aug 28Uploaded byMarlon Boucaud
- Fpga Hardware DesignUploaded byyogeee2
- Vhdl Lecture Notes - NavabiUploaded byNishant Chaudhari
- 8-Bit Array MultiplierUploaded byKyle Sanders
- 74HC4040Uploaded bytt884211
- Paper 10Uploaded byRakeshconclave
- VHDLUploaded byPriya Malhotra
- floating point multiplierUploaded bybindu_anku
- AYADAVUploaded byAnsh Sharma
- Data SheetUploaded bydecabg591
- An 8 Bit Multiplier project reportUploaded byAsad Malik
- Ecad & Vlsi Lab(3)Uploaded bybitsece
- Lab 1Uploaded byThanh Tran
- CodeUploaded byDươngTrần
- Digital Lab Datasheets FinalUploaded byGeorgeProimakis
- 2A03 Technical ReferenceUploaded byAndrés Martín Huayhuameza Huamani
- COUNTERS.docUploaded bysania2011
- PWM AlgorithmUploaded bysiddhartha_anirban
- 4097450.pdfUploaded byVic Pagola
- h 0353044049Uploaded byInternational Journal of computational Engineering research (IJCER)
- lec20Uploaded byapi-284874578
- Guide for AVR TimersUploaded bykarolco
- HSCUploaded byPhung Cuong
- Mindtree Placement Paper 1Uploaded bykumar_gulshan
- VHDL programsUploaded byNihas Sirajdheen
- TimersUploaded bySaravanan T Y
- Lecture SYS 027 Synthesis SequentialUploaded byPRAVEEN034
- Ovl Quick Ref v2p1Uploaded byyang0278
- Elec Answers Counters DiodesUploaded byTejaswi Kasturi
- Tut Quartus Intro VhdlUploaded byhexinfx

- đăng kí thực tậpUploaded byAnh Trai Em Ốc
- UNIT2-The Phases of a CompilerUploaded byAnh Trai Em Ốc
- Crypto ProtocolUploaded byAnh Trai Em Ốc
- MultiPath in WSNUploaded byAnh Trai Em Ốc
- Software Engineering by SachinrajUploaded bysachinraj2
- NS6_DosAttacksUploaded byAnh Trai Em Ốc
- compiler construction chap1 - introductionUploaded byAnh Trai Em Ốc
- EXAM_OF_SE_MATI_2010Uploaded byAnh Trai Em Ốc
- Bai Tap Tu Luan Nhom Va Kim Loai IA IIACo Dap an.11282Uploaded byAnh Trai Em Ốc
- Nhiệt nhômUploaded byAnh Trai Em Ốc
- software engineering exrciseUploaded byAnh Trai Em Ốc
- e1457079e2c621f550cc424da38927e3Uploaded byAnh Trai Em Ốc
- OutputUploaded byAnh Trai Em Ốc
- Danh_sach_HP_Dot_3_-da_nop_du_-7.12(1)Uploaded bysvan_5

- 6. 3BSE035983-510_-_en_AC_800M_5.1_OPC_ServerUploaded bybacuoc.nguyen356
- Using QuarkXPressUploaded byeugeniabadi
- Watchdog 20110611Uploaded byfridgecow
- GoogleUploaded bysabam
- TipsAndTricks_NTFS - CentOS WikiUploaded byhm1019
- Cryptolocker for Terminal ServersUploaded byxy
- ASHRAE-FeaturedPublicationsCatalogWinter2018Uploaded byWin Min Oo
- Assignment 1Uploaded byjohn tyler
- Oracle Total Recall With 11g(2) ReleaseUploaded byVikram Sheth
- Book EngineeringEthicsUploaded byMahesh Tadalapur
- DHCPv6 using the Prefix Delegation.pdfUploaded byElquia Madrid
- Essentials of Marketing Research 6th Edition Test BankUploaded byStephanie.Henry1
- Management Science Question BankUploaded byvamsibu
- UCSM GUI Configuration GuideUploaded bymonstratonis
- Classification of ComputersUploaded byeduardo acunia
- customer service representative or human resource administratorUploaded byapi-77639749
- ENSC 488 homework-1 solutionUploaded byMajed Kawam
- ying luoUploaded byAshish Singh
- AS400 CommandsUploaded bycoolpraveen
- preparing your paper presentationUploaded byayyub_rahi
- ipv6Uploaded byaimi99
- Service Delivery Status Report V1.0 - T18-183 - ExampleUploaded byAyman Hadi
- Gestión de Calidad en fabricación de la producción.pdfUploaded byOnasis Talamantes
- 2416.pdfUploaded byashikmh
- As 4156.2.1-2004 Coal Preparation Higher Rank Coal - Froth Flotation - Basic TestUploaded bySAI Global - APAC
- VisuHole - User Manual - English - V1.0 - 19 Sep 14Uploaded byApril Washington
- Unix BomberUploaded bymuiruriandrew3799
- TRIOZ RegSysUploaded byMdhr Sagar
- Essence of Classes and Objects in OopUploaded bydnlkaba
- LightPointe 20th Year Customer Appreciation Celebration Continues as It Rolls Out Limited Time Summer Savings on AireLink 60 GHz and 80 GHz Wireless BridgesUploaded byPR.com