Conditional Signal Assignment

Slides:



Advertisements
Similar presentations
1 Combinational Logic Design&Analysis. 2 Introduction We have learned all the prerequisite material: – Truth tables and Boolean expressions describe functions.
Advertisements

VHDL Structural Architecture ENG241 Week #5 1. Fall 2012ENG241/Digital Design2 VHDL Design Styles Components and interconnects structural VHDL Design.
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.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
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.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
EE 367 – Logic Design Lecture #17
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
Digital Arithmetic and Arithmetic Circuits
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
Tutorial 1 Combinational Logic Synthesis. Introduction to VHDL VHDL = Very high speed Hardware Description Language VHDL and Verilog are the industry.
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
Shannon decomposition William Sandqvist Claude Shannon mathematician / electrical engineer (1916 –2001) William Sandqvist
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Digital Logic Design.
ECE 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
EE3A1 Computer Hardware and Digital Design Lecture 2 Introduction to VHDL.
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
George Mason University Data Flow Modeling in VHDL ECE 545 Lecture 7.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
Lecture #18 Page 1 ECE 4110– Sequential Logic Design Lecture #18 Agenda 1.MSI Demultiplexers 2.MSI Tri-State Buffers 3.MSI Comparators Announcements 1.HW.
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
ECOM 4311—Digital System Design with VHDL
Data Flow Modeling in VHDL
Advanced FPGA Based System Design Lecture-6 & 7 VHDL Data Types By: Dr Imtiaz Hussain 1.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Sequential Logic Design.
Lecture #17 Page 1 ECE 4110–5110 Digital System Design Lecture #17 Agenda 1.MSI Multiplexers 2.MSI Encoders Announcements Test 1 closed book, Wednesday.
CDA 4253 FPGA System Design Behavioral modeling of Combinational Circuits Hao Zheng Dept of Comp Sci & Eng USF.
George Mason University Data Flow Modeling of Combinational Logic ECE 545 Lecture 5.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
IAY 0600 Digital Systems Design
Combinational logic circuit
Describing Combinational Logic Using Processes
Behavioral Style Combinational Design with VHDL
IAY 0600 Digital Systems Design
ECE 4110–5110 Digital System Design
Part II A workshop by Dr. Junaid Ahmed Zubairi
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Dataflow Style Combinational Design with VHDL
Behavioral Style Combinational Design with VHDL
Topics The if Statement The if-else Statement Comparing Strings
Combinational Circuits Using VHDL
Advanced Digital design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
IAS 0600 Digital Systems Design
ECE 434 Advanced Digital System L08
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
OPERATORS and CONCURRENT STATEMENTS
IAS 0600 Digital Systems Design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Modeling of Combinational Logic
VHDL (VHSIC Hardware Description Language)
VHDL Structural Architecture
Concurrent vs Sequential
IAS 0600 Digital Systems Design
Gates Type AND denoted by X.Y OR denoted by X + Y NOR denoted by X + Y
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 331 – Digital System Design
Data Flow Description of Combinational-Circuit Building Blocks
IAS 0600 Digital Systems Design
IAS 0600 Digital Systems Design
Data Flow Description of Combinational-Circuit Building Blocks
Single bit comparator Single bit comparator 4/10/2007 DSD,USIT,GGSIPU
CprE / ComS 583 Reconfigurable Computing
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Conditional Signal Assignment

Let’s consider a Priority Encoder - PENC Let’s consider a Priority Encoder - PENC. Usually a PENC has 2n inputs and n outputs. It determines the index of the active input. For example, an input is active if it is ‘0’-logic. If the number of inputs is four and their values are: i0 i1 i2 i3 1 1 0 1, then i2 is the only active input, so the output must be 210=0102.

What if the inputs are i0 i1 i2 i3 1 0 0 1, or 0 0 0 0 ? Clearly, an additionally rule is necessary: If there are many active inputs, the PENC will output the smallest index from the indices of the active inputs. This is the software interpretation!

The smallest index rule determines a priority structure: smaller the index of an input, greater the priority of that input. For the inputs i0 i1 i2 i3 1 0 0 1, the output is 110=0012 and for the inputs: 0 0 0 0 the output is 010=0002 Concluding, a PENC outputs the index of the highest priority ACTIVE input. This is the hardware interpretation! PENCs are used in interrupt systems.

The truth table is large enough – 16 lines. The truth table for a PENC4 is: i0 i1 i2 i3 c1 c0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 ? ? The truth table is large enough – 16 lines. How large would be the truth table for a PENC8? 256 lines! Selected signal assignment doesn’t work too well!

The truth table for a PENC4 is: i0 i1 i2 i3 c1 c0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 ? ? ≡ i0 i1 i2 i3 c1 c0 0 x x x 0 0 1 0 x x 0 1 1 1 0 x 1 0 1 1 1 0 1 1 1 1 1 1 ? ? How would you implement this in C? if (i0==0) c=00; else if (i1==0) c=01; else if (i2==0) c=10; else c=11;

Conditional signal assignment: Similar to if-then-elseif-then-elseif- ….else in C. Syntax: target_signal <= expression1 when bcond1 else expression2 when bcond2 else • • • expressionN when bcondN else expressionN+1; Target_signal can be scalar or composite. A signal is assigned expression1 if the boolean condition bcond1 is met. Otherwise, the next condition after the else clause is checked, etc. If no condition is met, expressionN+1 is assigned. Conditions may overlap. Any else is optional. There can be no else.

PENC4: Entity PENC4 is Port ( iaI : in std_logic_vector (3 downto 0); oAct : out std_logic; -- Active oaC : out std_logic_vector (1 downto 0) ); end; architecture a of PENC4 is Begin oaC <= “00” when iaI(0)=‘0’ else “01” when iaI(1)=‘0’ else “10” when iaI(2)=‘0’ else “11”; oAct <= ‘1’ when iaI/=“1111” else ‘0’; i0 i1 i2 i3 c1 c0 x 1 ?

Exercises -1 Using only parallel statements, write the VHDL code for a combinational circuit whose input is a 4-bit vector. The circuit’s output is ‘1’ when the two halves of the vector are complementary and ‘0’ otherwise. For example, if the input is “1100” the output will be ‘1’ because NOT “11” = “00”. If the input is “1010” the output will be ‘0’ because NOT “10” ≠ “10”.

For A=”001” and B=”001” the output will be ‘0’. Exercises - 2 Using only parallel statements, write the VHDL code for a combinational circuit whose input consists of two one-dimensional arrays, A and B. The length of each array is 3-bit. The circuit’s output is ‘1’ when the value of A is the mirror image of B’s value (A’s value read from left to right equals the value of B read from right to left). For example, if A=”110” and B=”011” the output ‘1’ because A read from left to right is ‘1’, ‘1’, ‘0’ and B read from right to left is also ‘1’, ‘1’, ‘0’. For A=”001” and B=”001” the output will be ‘0’.

Exercises – 3 Using only parallel statements, slices and concatenation, write the VHDL code for a combinational circuit which rotates left its input. iaD(7 downto 0) is the input vector. iaN(3 downto 0) specifies the number of rotations oaY(7 downto 9) is the output vector.