Introduction to VHDL Multiplexers Discussion D1.1.

Slides:



Advertisements
Similar presentations
Multiplexers Section 3-7 Mano & Kime. Multiplexers & Demultiplexers Multiplexers (Selectors) Lab 1 – Behavioral VHDL -- Multiplexers MUX as a Universal.
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.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
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;
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Top-level VHDL Designs
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
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.
Single-Cycle Instructions VHDL Tutorial R. E. Haskell and D. M. Hanna T5: VHDL ROM.
Digilent Spartan 3 Board Lecture L2.2
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.
Structural VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T3: ALU Design.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
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 (*)
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
From Transistors To Computers. Gajski and Kuhn’s Y Chart Physical/Geometry Structural Behavioral Processor Hardware Modules ALUs, Registers Gates, FFs.
FPGAs and VHDL Lecture L13.1 Sections 13.1 – 13.3.
Programming in VHDL Using Processes. How Processes Run A process is either in suspend mode or is running. For a process to run, there has to be a change.
Logic Design Fundamentals - 2 Lecture L1.2. Logic Design Fundamentals - 2 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
7-Segment Displays Digilent Spartan 3 Board Discussion DS-4.2.
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
Introduction to Verilog Multiplexers. Introduction to Verilog Verilog Hardware Description Language (Verilog HDL) released by Gateway Design Automation.
1 Comparators: Procedures Discussion D9.2 Example 22.
VHDL Examples Subra Ganesan Reference: Professor Haskell’s Notes,
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.
ENG2410 Digital Design LAB #8 LAB #8 Data Path Design.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
VHDL Basics. VHDL BASICS 2 OUTLINE –Component model –Code model –Entity –Architecture –Identifiers and objects –Operations for relations VHDL ET062G &
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
IAY 0600 Digital Systems Design VHDL discussion Dataflow Style Combinational Design Alexander Sudnitson Tallinn University of Technology.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
CS/EE 3700 : Fundamentals of Digital System Design
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Lecture 8 Review Combinational Devices –Decoder –Multiplexor (Bhasker p-81) –Shifter –Barrel Shifter (Bhasker p-303)
Prime Numbers Lecture L6.1 Sieve of Eratosthenes.
Lecture #18 Page 1 ECE 4110–5110 Digital System Design Lecture #18 Agenda 1.MSI Demultiplexers 2.MSI Tri-State Buffers 3.MSI Comparators Announcements.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
IAY 0600 Digital Systems Design
Combinational logic circuit
Describing Combinational Logic Using Processes
Part II A workshop by Dr. Junaid Ahmed Zubairi
Comparators Discussion DS-3.1.
Combinational Circuits Using VHDL
Mano and Kime Sections 7-6 – 7-8
A Data Stack CoreGen Discussion 12.1.
Concurrent vs Sequential
A Greatest Common Divisor (GCD) Processor
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Fibonacci Sequence Lecture L4.1 Lab 3.
Fast, Asynchronous SRAM
High-Low Guessing Game
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Introduction to VHDL Multiplexers Discussion D1.1

Multiplexers A multiplexer is a digital switch MUX n control lines s( 0, n-1) 2 n inputs X(0, 2 n -1) 1 output, Z = X(s)

Multiplexers Y 4 x 1 MUX s0s1 C0 C1 C2 C3 Y s1s0 0 0 C0 0 1 C1 1 0 C2 1 1 C3

Multiplexers Y 4 x 1 MUX s0s1 C0 C1 C2 C3 Y s1s0 0 0 C0 0 1 C1 1 0 C2 1 1 C3 0 A multiplexer is a digital switch

Multiplexers Y 4 x 1 MUX s0s1 C0 C1 C2 C3 Y s1s0 0 0 C0 0 1 C1 1 0 C2 1 1 C3 0 1

Multiplexers Y 4 x 1 MUX s0s1 C0 C1 C2 C3 Y s1s0 0 0 C0 0 1 C1 1 0 C2 1 1 C3 1 0

Multiplexers Y 4 x 1 MUX s0s1 C0 C1 C2 C3 Y s1s0 0 0 C0 0 1 C1 1 0 C2 1 1 C3 1

A 2 x 1 MUX Behavior if (s0 = '0') then Z := A; else Z := B; end if;

A 4 x 1 MUX if (s0 = '0') then A := C0; B := C2; else A := C1; B := C3; end if; if (s1 = '0') then Z := A; else Z := B; end if; if (s1 = '0') then if (s0 = '0') then Z := C0; else Z := C1; end if; else if (s0 = '0') then Z := C2; else Z := C3; end if;

A 4 x 1 MUX case s is when "00" => Z <= C0; when "01" => Z <= C1; when "10" => Z <= C2; when others => Z <= C3; end case;

n-line 2-to-1 Multiplexer n-line 2 x 1 MUX a(n-1:0) b(n-1:0) y(n-1:0) sel sel y 0 a 1 b

library IEEE; use IEEE.std_logic_1164.all; entity mux2g is generic (width:positive); port ( a: in STD_LOGIC_VECTOR(width-1 downto 0); b: in STD_LOGIC_VECTOR(width-1 downto 0); sel: in STD_LOGIC; y: out STD_LOGIC_VECTOR(width-1 downto 0) ); end mux2g; An n-line 2 x 1 MUX a(n-1:0) b(n-1:0) y(n-1:0) sel n-line 2 x 1 MUX

library IEEE; use IEEE.std_logic_1164.all; entity mux2g is generic (width:positive); port ( a: in STD_LOGIC_VECTOR(width-1 downto 0); b: in STD_LOGIC_VECTOR(width-1 downto 0); sel: in STD_LOGIC; y: out STD_LOGIC_VECTOR(width-1 downto 0) ); end mux2g; Entity Each entity must begin with these library and use statements port statement defines inputs and outputs generic statement defines width of bus

library IEEE; use IEEE.std_logic_1164.all; entity mux2g is generic (width:positive); port ( a: in STD_LOGIC_VECTOR(width-1 downto 0); b: in STD_LOGIC_VECTOR(width-1 downto 0); sel: in STD_LOGIC; y: out STD_LOGIC_VECTOR(width-1 downto 0) ); end mux2g; Entity Mode: in or out Data type: STD_LOGIC, STD_LOGIC_VECTOR(width-1 downto 0);

Standard Logic type std_ulogic is (‘U’, -- Uninitialized ‘X’ -- Forcing unknown ‘0’ -- Forcing zero ‘1’ -- Forcing one ‘Z’ -- High impedance ‘W’ -- Weak unknown ‘L’ -- Weak zero ‘H’ -- Weak one ‘-’); -- Don’t care library IEEE; use IEEE.std_logic_1164.all;

Standard Logic Type std_ulogic is unresolved. Resolved signals provide a mechanism for handling the problem of multiple output signals connected to one signal. subtype std_logic is resolved std_ulogic;

architecture mux2g_arch of mux2g is begin mux2_1: process(a, b, sel) begin if sel = '0' then y <= a; else y <= b; end if; end process mux2_1; end mux2g_arch; Architecture a(n-1:0) b(n-1:0) y(n-1:0) sel n-line 2 x 1 MUX Note: <= is signal assignment

architecture mux2g_arch of mux2g is begin mux2_1: process(a, b, sel) begin if sel = '0' then y <= a; else y <= b; end if; end process mux2_1; end mux2g_arch; Architecture entity name process sensitivity list Sequential statements (if…then…else) must be in a process Note begin…end in process Note begin…end in architecture

library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.std_logic_unsigned.all; entity Lab1 is port( SW : in STD_LOGIC_VECTOR(7 downto 0); BTN0 : in STD_LOGIC; LD : out STD_LOGIC_VECTOR(3 downto 0) ); end Lab1; Top-level design for Lab 1

architecture Lab1_arch of Lab1 is component mux2g generic( width : POSITIVE); port( a : in std_logic_vector((width-1) downto 0); b : in std_logic_vector((width-1) downto 0); sel : in std_logic; y : out std_logic_vector((width-1) downto 0)); end component; constant bus_width: integer := 4; begin mux2: mux2g generic map(width => bus_width) port map (a => SW(7 downto 4),b => SW(3 downto 0), sel => BTN0, y => LD); end Lab1_arch;

Lab1.ucf #PACE: Start of PACE I/O Pin Assignments NET "BTN0" LOC = "M13" ; NET "LD " LOC = "K12" ; NET "LD " LOC = "P14" ; NET "LD " LOC = "L12" ; NET "LD " LOC = "N14" ; NET "SW " LOC = "F12" ; NET "SW " LOC = "G12" ; NET "SW " LOC = "H14" ; NET "SW " LOC = "H13" ; NET "SW " LOC = "J14" ; NET "SW " LOC = "J13" ; NET "SW " LOC = "K14" ; NET "SW " LOC = "K13" ;

architecture Lab1_arch of Lab1 is component mux2g generic( width : POSITIVE); port( a : in std_logic_vector((width-1) downto 0); b : in std_logic_vector((width-1) downto 0); sel : in std_logic; y : out std_logic_vector((width-1) downto 0)); end component; constant bus_width: integer := 4; begin mux2: mux2g generic map(width => bus_width) port map (a => SW(7 downto 4),b => SW(3 downto 0), sel => BTN0, y => LD); end Lab1_arch;

An n-line 4 x 1 multiplexer a(n-1:0) b(n-1 :0) y(n-1 :0) sel(1:0) 8-line 4 x 1 MUX c(n-1 :0) d(n-1 :0) Sely “00”a “01”b “10”c “11”d

An 8-line 4 x 1 multiplexer library IEEE; use IEEE.std_logic_1164.all; entity mux4g is generic(width:positive := 8); port ( a: in STD_LOGIC_VECTOR (width-1 downto 0); b: in STD_LOGIC_VECTOR (width-1 downto 0); c: in STD_LOGIC_VECTOR (width-1 downto 0); d: in STD_LOGIC_VECTOR (width-1 downto 0); sel: in STD_LOGIC_VECTOR (1 downto 0); y: out STD_LOGIC_VECTOR (width-1 downto 0) ); end mux4g;

Example of case statement architecture mux4g_arch of mux4g is begin process (sel, a, b, c, d) begin case sel is when "00" => y <= a; when "01" => y <= b; when "10" => y <= c; when others => y <= d; end case; end process; end mux4g_arch; Must include ALL possibilities in case statement Note implies operator => Sely “00”a “01”b “10”c “11”d