Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3.

Slides:



Advertisements
Similar presentations
LECTURE 4: The VHDL N-bit Adder
Advertisements

Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Arbitrary Waveform Discussion 5.5 Example 34.
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)
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.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
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.
RS-232 Port Discussion D7.1. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
Single-Cycle Instructions VHDL Tutorial R. E. Haskell and D. M. Hanna T5: VHDL ROM.
Digilent Spartan 3 Board Lecture L2.2
Structural VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T3: ALU Design.
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.
Finite State Machines Discussion D7.1 Mealy and Moore Machines.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
7-Segment Display DIO1 Board. Digilab2 – DIO1 Boards Four 7-segment displays A0A1A2A3.
Introduction to VHDL Multiplexers. Introduction to VHDL VHDL is an acronym for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
Lecture L6.2 VHDL Multiply Operator (*)
Division Lecture L6.3. Division
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
Finite State Machines Mano and Kime Sections 4-4, 4-5, 4-8.
Digilab 7-Segment Displays Lab 4. selyInstruction name “000”true if b = a false otherwise = “001”true if b /= a false otherwise “010”true if b < a.
Switches, Pushbuttons, and LEDs Digilent Spartan 3 Board Lecture L2.1.
Finite State Machines Discussion D8.1 Example 36.
Digilent Spartan 3 Board Discussion D3.3
7-Segment Displays Digilent Spartan 3 Board Discussion DS-4.2.
Introduction to VHDL Multiplexers Discussion D1.1.
VGA Port Discussion D9.1. Raster Scan Displays Electron beam CRT.
Division Discussion D11.3. Division
7-Segment Displays VHDL Tutorial R. E. Haskell and D. M. Hanna T4: Xilinx LogiBLOX.
Sequential Multiplication Lecture L6.4. Multiplication 13 x = 8Fh 1101 x
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);
7-Segment Display DIO1 Board Verilog.
ECE 448: Spring 12 Lab 4 – Part 2 Finite State Machines Basys2 FPGA Board.
PS/2 Mouse/Keyboard Port Discussion D7.2. PS/2 Port.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
Digilab2 DIO1 Board. Digilab2 – DIO1 Boards 50 MHz clock mclk Prom socket Spartan IIE.
ENG2410 Digital Design LAB #8 LAB #8 Data Path Design.
ENG2410 Digital Design LAB #5 Modular Design and Hierarchy using VHDL.
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
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.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
INF H131 Clock and Reset Unit (CRU) module library ieee; use ieee.std_logic_1164.all; entity cru is port ( arst : in std_logic; -- Asynch. reset.
Prime Numbers Lecture L6.1 Sieve of Eratosthenes.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
LAB #5 Modular Design and Hierarchy using VHDL
Combinational logic circuit
Lecture L5.1 Mealy and Moore Machines
ENG6530 Reconfigurable Computing Systems
LIBRARY IEEE; Include Libraries for standard logic data types USE IEEE.STD_LOGIC_1164.ALL; -- Entity name normally the same as file name.
LIBRARY IEEE; Include Libraries for standard logic data types USE IEEE.STD_LOGIC_1164.ALL; -- Entity name normally the same as file name.
Getting Started with Vivado
A Greatest Common Divisor (GCD) Processor
Fibonacci Sequence Lecture L4.1 Lab 3.
Multiplication Discussion 11.1.
Fast, Asynchronous SRAM
RS-232 Port Discussion D12.1.
VGA Port CSE 678.
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
Presentation transcript:

Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3

4-Bit Adder component adder4 port( A : in std_logic_vector(3 downto 0); B : in std_logic_vector(3 downto 0); carry : out std_logic; S : out std_logic_vector(3 downto 0)); end component;

Top-level Design

library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.std_logic_unsigned.all; entity Lab2 is port( mclk : in STD_LOGIC; SW : in STD_LOGIC_VECTOR(7 downto 0); BTN : in STD_LOGIC_VECTOR(3 downto 0); LD : out STD_LOGIC_VECTOR(7 downto 0); AtoG : out STD_LOGIC_VECTOR(6 downto 0); dp : out STD_LOGIC; AN : out STD_LOGIC_VECTOR(3 downto 0) ); end Lab2;

x7seg component x7seg port( x : in std_logic_vector(15 downto 0); cclk : in std_logic; clr : in std_logic; AtoG : out std_logic_vector(6 downto 0); AN : out std_logic_vector(3 downto 0)); end component;

Clock Divider signal cclk, carry: std_logic; signal clkdiv: std_logic_vector(23 downto 0); begin -- Divide the master clock (50Mhz) down to a lower frequency. process (mclk) begin if mclk = '1' and mclk'Event then clkdiv <= clkdiv + 1; end if; end process; cclk <= clkdiv(17); Hz = / 2^17

signal ground: std_logic_vector(2 downto 0); signal sum: std_logic_vector(3 downto 0); begin ground <= "000"; dp <= '1'; U1: adder4 port map (A => SW(7 downto 4), B => SW(3 downto 0), S => sum, carry => carry); U2: x7seg port map (x(15 downto 12) => SW(7 downto 4), x(11 downto 8) => SW(3 downto 0), x(7 downto 4) => sum, x(3 downto 1) => ground, x(0) => carry, clr => BTN(3), cclk => cclk, AN => AN, AtoG => AtoG); LD(7 downto 4) <= BTN; LD(3 downto 0) <= BTN;

signal ground: std_logic_vector(2 downto 0); signal sum: std_logic_vector(3 downto 0); begin ground <= "000"; dp <= '1'; U1: adder4 port map (A => SW(7 downto 4), B => SW(3 downto 0), S => sum, carry => carry); U2: x7seg port map (x(15 downto 12) => SW(7 downto 4), x(11 downto 8) => SW(3 downto 0), x(7 downto 4) => sum, x(3 downto 1) => ground, x(0) => carry, clr => BTN(3), cclk => cclk, AN => AN, AtoG => AtoG); LD(7 downto 4) <= BTN; LD(3 downto 0) <= BTN;

signal ground: std_logic_vector(2 downto 0); signal sum: std_logic_vector(3 downto 0); begin ground <= "000"; dp <= '1'; U1: adder4 port map (A => SW(7 downto 4), B => SW(3 downto 0), S => sum, carry => carry); U2: x7seg port map (x(15 downto 12) => SW(7 downto 4), x(11 downto 8) => SW(3 downto 0), x(7 downto 4) => sum, x(3 downto 1) => ground, x(0) => carry, clr => BTN(3), cclk => cclk, AN => AN, AtoG => AtoG); LD(7 downto 4) <= BTN; LD(3 downto 0) <= BTN;

signal ground: std_logic_vector(2 downto 0); signal sum: std_logic_vector(3 downto 0); begin ground <= "000"; dp <= '1'; U1: adder4 port map (A => SW(7 downto 4), B => SW(3 downto 0), S => sum, carry => carry); U2: x7seg port map (x(15 downto 12) => SW(7 downto 4), x(11 downto 8) => SW(3 downto 0), x(7 downto 4) => sum, x(3 downto 1) => ground, x(0) => carry, clr => BTN(3), cclk => cclk, AN => AN, AtoG => AtoG); LD(7 downto 4) <= BTN; LD(3 downto 0) <= BTN;