Divider Discussion D7.3 Example 20.

Slides:



Advertisements
Similar presentations
Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
Advertisements

1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
Division CPSC 321 Computer Architecture Andreas Klappenecker.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Arbitrary Waveform Discussion 5.5 Example 34.
Decoders Discussion D9.5 Example 25. Decoders 3-to-8 Decoder decoder38.vhd library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_unsigned.all;
Arithmetic Logic Unit (ALU)
Shifters Discussion D7.1 Example Bit Shifter.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Adder Discussion D6.2 Example 17. s i = c i ^ (a i ^ b i ) c i+1 = a i * b i + c i * (a i ^ b i ) Full Adder (Appendix I)
Top-level VHDL Designs
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Decoders and Encoders Lecture L4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
Comprehensive VHDL Module 6 Types November Comprehensive VHDL: Types Copyright © 2000 Doulos Types Aim ©To understand the use and synthesis.
1 Comparators Discussion D A 1-Bit Comparator The variable Gout is 1 if x > y or if x = y and Gin = 1. The variable Eout is 1 if x = y and Gin =
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3.
Division Lecture L6.3. Division
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
Digilent Spartan 3 Board Discussion D3.3
Multiplication and Division Lab 9. Multiplication 13 x = 8Fh 1101 x
Division Discussion D11.3. Division
Binary-to-BCD Converter
Arithmetic Logic Unit (ALU) Discussion D4.6. ALU N = negative flag (N=1 if y(n)=0 Z = zero flag (Z = 1 if Y = 0) V = overflow flag C = carry flag.
Binary-to-BCD Converter
4-Bit Binary-to-BCD Converter: case Statement
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
1 Comparators: Procedures Discussion D9.2 Example 22.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Binary-to-BCD Converter
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
Digital Systems Design VHDL simulation of a 3 – Bit Binary Decoder with Enable by Marc A. Mackey.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
 Day 1  Use long division to find (x 2 – 2x – 15) ÷ (x – 5).
Divide Polynomials using Long Division and Synthetic Division.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Division Quotient Divisor Dividend – – Remainder.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Number Representation and Arithmetic Circuits
Lecture 8 Review Combinational Devices –Decoder –Multiplexor (Bhasker p-81) –Shifter –Barrel Shifter (Bhasker p-303)
Multiplier: Functions Discussion D7.2 Example 19.
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
Combinational logic circuit
Describing Combinational Logic Using Processes
Comparators Discussion DS-3.1.
Combinational Circuits Using VHDL
BARREL SHIFTER.
CSCI206 - Computer Organization & Programming
Mano and Kime Sections 7-6 – 7-8
Binary-to-BCD Converter
VHDL (VHSIC Hardware Description Language)
Concurrent vs Sequential
ECE 331 – Digital System Design
Dividing a decimal by a whole number
Apply Exponent Properties Involving Quotients
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

Divider Discussion D7.3 Example 20

Division 10 1010 13 135 13 05 1101 10000111 1101 00111 0000 01111 00101 0101

Division 8-bit/4-bit = 4:4 1010 1101 10000111 1101 00111 0000 01111 00101 0101

Division 8-bit/4-bit = 4:4 1. Store the numerator in the concatenation of n1:n2 2. Store the denominator in d 3. Repeat 4 times: Shift n1:n2 left one bit If n1 > d n1 = n1 – d; n2[0] = 1; 4. quot = n2; rem = n1[3:0];

div4a.vhd Combinational divide -- Example 20a: 4-bit divider library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_unsigned.all; entity div4a is port( numer : in STD_LOGIC_VECTOR(7 downto 0); denom : in STD_LOGIC_VECTOR(3 downto 0); quotient : out STD_LOGIC_VECTOR(3 downto 0); remainder : out STD_LOGIC_VECTOR(3 downto 0) ); end div4a;

architecture div4a of div4a is begin process(numer,denom) variable d,n1: STD_LOGIC_VECTOR(4 downto 0); variable n2: STD_LOGIC_VECTOR(3 downto 0); d := '0' & denom; n2 := numer(3 downto 0); n1 := '0' & numer(7 downto 4); for i in 0 to 3 loop n1 := n1(3 downto 0) & n2(3); n2 := n2(2 downto 0) & '0'; if n1 >= d then n1 := n1 - d; n2(0) := '1'; end if; end loop; quotient <= n2; remainder <= n1(3 downto 0); end process; end div4a;

Divide Simulation

div synthesized circuit denom(3:0) remain(3:0) quot(3:0) numer(7:3) numer(2:0)

Top-level Design