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)

Slides:



Advertisements
Similar presentations
Adders and Subtractors
Advertisements

Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Arbitrary Waveform Discussion 5.5 Example 34.
Arithmetic Logic Unit (ALU)
Edge-Triggered D Flip-Flops Discussion D4.2 Example 26.
Multiplexer as a Universal Element Discussion D2.6 Example 9.
7-Segment Display: Spartan-3 board
Shifters Discussion D7.1 Example Bit Shifter.
Divider Discussion D7.3 Example 20.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Top-level VHDL Designs
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
2-to-1 Multiplexer: if Statement Discussion D2.1 Example 4.
Decoders and Encoders Lecture L4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
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.
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
Logic Design Fundamentals - 2 Lecture L1.2. Logic Design Fundamentals - 2 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Digilent Spartan 3 Board Discussion D3.3
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.
VHDL Examples Subra Ganesan Reference: Professor Haskell’s Notes,
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
AND Gate: A Logic circuit whose output is logic ‘1’ if and only if all of its inputs are logic ‘1’.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
ECE 448: Spring 12 Lab Midterm Exam Review. Part 1: Detailed discussion of a selected midterm from Spring Part 2: Review & discussion of common.
DSD,USIT,GGSIPU1 Entity declaration –describes the input/output ports of a module entity reg4 is port ( d0, d1, d2, d3, en, clk : in std_logic; q0, q1,
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
ENG2410 Digital Design LAB #8 LAB #8 Data Path Design.
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
Basic Overview of VHDL Matthew Murach Slides Available at:
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
ENG2410 Digital Design LAB #5 Modular Design and Hierarchy using VHDL.
1 component OR_3 port (A,B,C: in bit; Z: out bit); end component ; Reserved Words  Declarations of Components and Entities are similar  Components are.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
Digital System Projects
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 3: The VHDL N-bit Adder Instructor: Francis G. Wolff Case Western Reserve.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
Multiplier: Functions Discussion D7.2 Example 19.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Combinational logic circuit
Describing Combinational Logic Using Processes
Comparators Discussion DS-3.1.
ENG6530 Reconfigurable Computing Systems
Getting Started with Vivado
Binary-to-BCD Converter
VHDL (VHSIC Hardware Description Language)
Concurrent vs Sequential
Chapter 5 – Number Representation and Arithmetic Circuits
Figure 8.1. The general form of a sequential circuit.
Single bit comparator Single bit comparator 4/10/2007 DSD,USIT,GGSIPU
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
4-Input Gates VHDL for Loops
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

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)

-- Example 17a: 4-bit adder library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_unsigned.all; entity adder4a is port( a : in STD_LOGIC_VECTOR(3 downto 0); b : in STD_LOGIC_VECTOR(3 downto 0); cf : out STD_LOGIC; ovf : out STD_LOGIC; s : out STD_LOGIC_VECTOR(3 downto 0) ); end adder4a;

architecture adder4a of adder4a is -- intermediate carries signal c: STD_LOGIC_VECTOR(4 downto 0); begin c(0) <= '0'; s <= a xor b xor c(3 downto 0); c(4 downto 1) <= (a and b) or (c(3 downto 0) and (a xor b)); cf <= c(4); ovf <= c(3) xor c(4); end adder4a;

Aldec Active-HDL Simulation

Full Adder Truth table CiCi AiAi BiBi SiSi C i+1 Behavior C i+1 :S i = C i + A i + B i

Full Adder Block Diagram

4-Bit Adder c :a :b c4:s

-- Example 17a: 4-bit adder library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_unsigned.all; entity adder4b is port( a : in STD_LOGIC_VECTOR(3 downto 0); b : in STD_LOGIC_VECTOR(3 downto 0); cf : out STD_LOGIC; ovf : out STD_LOGIC; s : out STD_LOGIC_VECTOR(3 downto 0) ); end adder4b;

architecture adder4b of adder4b is begin process(a,b) variable temp: STD_LOGIC_VECTOR(4 downto 0); variable sv: STD_LOGIC_VECTOR(3 downto 0); variable cfv: STD_LOGIC; begin temp := ('0' & a) +('0' & b); sv := temp(3 downto 0); cfv := temp(4); ovf <= sv(3) xor a(3) xor b(3) xor cfv; cf <= cfv; s <= sv; end process; end adder4b; c :a :b c4:s

Aldec Active-HDL Simulation

-- Example 17c: 4-bit adder library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_unsigned.all; entity adder is generic(N:positive := 8); port( a : in STD_LOGIC_VECTOR(N-1 downto 0); b : in STD_LOGIC_VECTOR(N-1 downto 0); s : out STD_LOGIC_VECTOR(N-1 downto 0) ); end adder; architecture adder of adder is begin process(a,b) begin s <= a + b; end process; end adder; N-Bit Adder

Aldec Active-HDL Simulation