ECEU530. Homework 2. ECE U530 Digital Hardware Synthesis. Homework 2: Waveforms. Debugging VHDL

Size: px
Start display at page:

Download "ECEU530. Homework 2. ECE U530 Digital Hardware Synthesis. Homework 2: Waveforms. Debugging VHDL"

Transcription

1 ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser October 4, 2006 Lecture 8: Homework 2 -- due Thursday October 5 by 2pm Projects Homework 3 VHDL arithmetic Reading: Sections 4.1, 4.2, 8.4, 8.5 me your project idea by Tuesday October 10! Homework 3 due October 18 Project Proposals due October 18 Homework 2 Now due on Thursday October 5 th by 4pm Describe a seven segment decoder Implementing the equations using std_logic Implementing the truth table using std_logic_vector Submit simulation results for both No need to do a structural description! For std_logic_vector : Create a four bit std_logic_vector for the inputs and a seven bit std_logic_vector for the outputs. These should be internal signals. Assign the inputs (A,B,C,D) to the input vector. In a case statement, choose a combination of inputs and for that combination assign outputs. To get the outputs in the entity you will need to select each of the output bits and assign them to the approprate signal in the entity. ECE U530 F06 2 Homework 2: Waveforms Debugging VHDL Submit a waveform for each Waveforms should be complete: Show outputs for all combinations of 4 inputs: A, B, C and D Easier to do all combinations in a testbench An example testbench was posted with Homework 1 solutions Submit waveform from Modelsim Save as a bitmap file Lab 2, page 5 explains how to save the waveform VHDL Errors can be cryptic!to debug: synthesize your VHDL in Xilinx. Click on the Errors tab at the bottom to see the error messages Click on the VHDL source code in Xilinx, then click on launch Modelsim simulator Sometimes Modelsim gives you better error messages, sometimes Xilinx does. Try looking in both places. 3 4

2 Testbench from HW1 ENTITY testbench IS END testbench; ARCHITECTURE behavior OF testbench IS signal input: std_logic_vector(7 downto 0); signal output : std_logic; COMPONENT aoi PORT(a : IN std_logic; b : IN std_logic; c : IN std_logic; d : IN std_logic; e : IN std_logic; f : IN std_logic; g : IN std_logic; h : IN std_logic; y : OUT std_logic ); END COMPONENT; BEGIN uut: aoi PORT MAP(a => input(0), b => input(1), c => input(2), d => input(3), e => input(4), f => input(5), g => input(6), h => input(7), y => output); tb : PROCESS variable i : integer :=0; BEGIN for i in 0 to 127 loop input <= conv_std_logic_vector(i,8); wait for 10 ns; -- will wait forever end loop; END PROCESS; END; Projects Individual project implementing a design in VHDL Team projects if the parts are well defined Complexity about the same as the calculator in ECEU323 Some project ideas: A simple computer An elevator controller A robot controller Deadlines: October 9: Send me your idea October 18: Write a short project proposal Nov 8: Progress Report Nov 20: Preliminary Project Report Dec 13: Final Project Report Due 5 6 Project Proposal (Handout 4) Description of what you will describe in VHDL A detailed plan of how you will implement your project Several different implementations, each adding more functionality Example: Elevator controller 1 elevator, 2 floors, only up and down buttons at each floor add buttons inside the elevator add open/close door functionality add more floors, more elevators... Specification of all inputs and outputs you anticipate Entity in VHDL Schedule for the rest of the semester Homework 3 due Wed, October 18 Write a VHDL description of the ALU from ECEU323 lab 3 Your solution should include: An entity that describes the interface of the ALU Some ports are std_logic and some ports are std_logic_vector An architectural body for the ALU You may use any technique you wish What is hard? Getting the arithmetic right Carry, borrow and overflow Writing the testbench Homework 4 will ask you to write a testbench for your ALU 7 8

3 Package std_logic_1164 library IEEE; use IEEE.std_logic_1164.all; Defines types: std_ulogic std_logic std_ulogic_vector std_logic_vector Defines logical, relation operations on these types Does NOT define arithmetic operations on these types Types signed and unsigned type unsigned is array (natural <>) of std_logic; type signed is array (natural <>) of std_logic; Defined in packages: package std_logic_arith (signed) package std_logic_unsigned (unsigned) These packages define arithmetic operations on type signed and unsigned Arithmetic is either unsigned or signed two s complement 9 10 Numeric Packages If you want arithmetic operations, your code should start with: library IEEE; use IEEE.std_logic_1164.all; use ieee.numeric_std.all; or library IEEE; use IEEE.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; The second option is what the Xilinx tools use by default Representing Signed Values Value Sign Magnitude one s comp two s comp

4 Types Signed and Unsigned Data Type Value unsigned 0 to 2 N - 1 signed -2 (N-1) to 2 (N-1) signed two s complement signal A_unsigned: unsigned(3 downto 0); signal B_signed: signed(3 downto 0); signal C_slv: std_logic_vector(3 downto 0); A_unsigned <= 1111 ; -- value is B_signed <= 1111 ; -- value is C_slv <= 1111 ; -- value is Types Signed and Unsigned definitions of types Unsigned and Signed are identical to definition of std_logic_vector: type UNSIGNED is array (natural range <>) of std_logic; type SIGNED is array (natural range <>) of std_logic; How are these types distinguished from one another? How do these generate signed and unsigned arithmetic? Signed and Unsigned Arithmetic Signed and Unsigned Arithmetic For each operator, a unique function is called: function + (L,R: signed) return signed; function + (L,R: unsigned) return unsigned; UNSIGNED ( 1000 ) SIGNED ( 1001 ) SIGNED ( 0101 ) SIGNED ( 1011 ) -- has value -- has value -- has value -- has value This is called operator overloading A different + function is called depending on the types of the operands VHDL uses operator overloading often relational operators logical operators arithmetic operators What is difference? how bits are interpretted how +, - are defined how relational operations are defined: is 1011 < 1010? 15 16

5 More Operators Arithmetic operators (defined on types integer, signed, unsigned) +, -, & Unary (sign) operators: +, - on integers Multiplying operators: * / mod rem Other operators: ** raise to a power: must be 2**n to synthesize (for most CAD tools) abs defined on signed types only not Note: mod and rem return the same result, but may differ in their sign depending on the sign of the divisor Arithmetic Operators Logic operators are defined as bitwise on std_logic_vectors: signal A,D: std_logic_vector(3 downto 0); signal B,C: std_logic_vector(1 downto 0); signal check: Boolean; D <= (not B) & (not C); check <= ( D = (not (B & C))); Can t add, subtract std_logic_vectors Can add, subtract signed, unsigned Unless you use package std_logic_unsigned Allows you to add, subtract slv using unsigned arithmetic Not recommended Arithmetic Operators Types and Subtypes Convert std_logic_vectors to signed or unsigned first signal A: std_logic_vector(3 downto 0); signal A_unsigned: unsigned(3 downto 0); A_unsigned <= unsigned (A); A <= std_logic_vector (A_unsigned); unsigned () and std_logic_vector () are type conversion functions they are overloaded functions std_logic_vector () is defined differently for parameters of type signed and unsigned Users can specify new types and new subtypes A subtype is a constrained version of an existing type subtype small_int is integer range -128 to 127; variable deviation: small_int; variable adjustment: integer; deviation := deviation + adjustment; This is legal VHDL. Can mix types small_int and integer. Result must be in the range -128 to 127. Can use all the operations of integer with a subtype based on integer 19 20

6 Types vs. Subtypes A new type is different from its base type A subtype inherits all the functions of its base type (including defined operators!) subtype four_bit is std_logic_vector(3 downto 0); type four_array is array(3 downto 0) of std_logic; Cannot write: type four_array2 is std_logic_vector(3 downto 0); can add signals of type four_bit cannot add signals of type four_array2: have to specify + function first Use subtypes for restricted data ranges Use types for new, enumerated types Numeric Packages Your code should start with (default in Xilinx): library IEEE; use IEEE.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; std_logic_1164 defines std_logic, std_logic_vector std_logic_unsigned defines unsigned arithmetic on standard logic vector std_logic_arith defines signed two s complement data types and arithmetic and unsigned data types and arithmetic Signed and Unsigned Arithmetic type unsigned is array (natural <>) of std_logic; type signed is array (natural <>) of std_logic; type std_logic_vector is array (natural <>) of std_logic; How are these types distinguished from one another? How do they generate unsigned and signed arithmetic? function + (L, R: signed) return signed; function + (L, R: unsigned) return unsigned; Which function is used depends on types: A + B Operator Overloading Operator Left Right Result Logic TypeA TypeA TypeA Numeric Array Array Array Array Integer Array Integer Array Array Array is unsigned, signed or std_logic_vector TypeA is Boolean, std_logic, bit, bit_vector, std_logic_vector Array and TypeA types used in a single expression must be the same 23 24

7 Overloading Examples signal A_uv, B_uv, C_uv, D_uv: unsigned(7 downto 0); signal R_sv, S_sv, T_sv, U_sv: signed (7 downto 0); signal J_slv, K_slv, L_slv: std_logic_vector (7 downto 0); signal Y_sv: signed (8 downto 0); --Permitted A_uv <= B_uv + C_uv; -- Unsigned + Unsigned = Unsigned D_uv <= B_uv + 1; -- Unsigned + Integer = Unsigned R_sv <= S_sv + T_sv; -- signed + signed = signed U_sv <= S_sv + 1; -- signed + Integer = signed J_slv <= K_slv + L_slv; -- if using std_logic_unsigned --Illegal Y_sv <= A_uv - B_uv; -- why? what if want -- signed result? Strong Typing Size and type of left hand side of signal assignment must match size and type of right hand side Each operation returns a result that has a specific size based on rules of the operation A length is length of array A length is a VHDL attribute: Not synthesizable Idea behind strong typing => catch errors early Strong Typing Examples Types and Addition Operation Y <= ; Y <= X AA ; Y <= A and B; W <= A > B; Y <= A + B; Y <= A + 10; V <= A * B; Size of Y = Size of Expression number of digits in literal 4 * (number of digits) A length = B length Boolean Maximum(A Length, B Length) A Length A Length + B Length signal A8, B8, Result8 : unsigned(7 downto 0); signal Result9 : unsigned(8 downto 0); signal Result7 : unsigned(6 downto 0); Simple addition, no carry out Result8 <= A8 + B8; -- For smaller result choose part of inputs Result7 <= A8(6 downto 0) + B8(6 downto 0); 27 28

8 Carry out Suppose want carry out from result? Need to make result one bit longer than inputs but type of RHS and LHS must match. Extend RHS signals by one bit using concatenation: signal A8, B8, Result8 : unsigned(7 downto 0); signal Result9 : unsigned(8 downto 0); -- Carry out in result Result9 <= ( 0 & A8) + ( 0 & B8); What about signed values? Will this work? Type Conversion Functions VHDL is dependent on overloading operators and on type conversions Conversion functions needed: Signed and unsigned <=> std_logic_vector signed and unsigned <=> integer std_logic_vector <=> integer These conversion functions are built in to the arithmetic packages You need to explicitly use them Types convert automatically if one is the subtype of another Subtracting unsigned vectors What if I want to subtract: unsigned unsigned and get a signed result? signal X_uv, Y_uv: unsigned ( 6 downto 0); signal Z_sv: signed (7 downto 0); Z_sv <= signed ( 0 & X_uv) signed ( 0 & Y_uv); Functions in std_logic_arith function + (L, R: signed) return signed; function + (L:signed, R: unsigned) return signed; function + (L:unsigned, R: signed) return signed; What if I write: Z_sv <= A_sv ; is 1010 unsigned? value signed? value 31 32

9 Std_logic_arith: literals Z_sv <= A_sv + signed ( 1010 ); Note you need the for the type conversion function alternatively, use an integer Z_sv <= A_sv 6; Addition Operators Arithmetic with unsigned numbers Add_uv <= A_uv + B_uv; Sub_uv <= C_uv D_uv; Size of result = size of largest RHS operand Size of ADD = maximum (A, B) Shorter array is extended Unsigned with Integers Inc_uv <= Base_uv + 1; Y_uv <= A_uv + 45; Integers must fit into an array the same size as the result Extra MSB digits are lost Use integers with care Synthesis tool creates 32 bit wide registers, adders, etc for unconstrained integers: signal Y_int, A_int, B_int: integer; Y <= A_int + B_int; Better: signal A_int, B_int: integer range -8 to 7; signal Y_int: integer range -16 to 15; Y_int <= A_int + B_int; Recommendation: Use integers only as constants and literals: Y_uv <= A_uv + 17; Carry Out and Overflow If you add two unsigned numbers, you may get a carry out from the MSB Carry out means that you have overflowed the range of an unsigned value Two inputs, A, B are 4 bits, Result is too big for 4 bits If you add two signed numbers you may get an overflow from the MSB Overflow means that you have overflowed the range of a signed value Overflow is different from Carry Out You can have overflow and no carry out, carry out and no overflow 35 36

10 Carry out and overflow 5, 7, -5, -7 represented as 4 bit, signed values: , 1011, overflow, no carry out no overflow, no carry out Carry out and overflow 5, 7, -5, -7 represented as 4 bit, signed values: , 1011, no overflow, carry out overflow, carry out Detecting overflow and carry out Detecting carry out is easy convert signals to unsigned extend inputs by concatenating a zero to the MSB if MSB of result is 1 then you have carry out How do you detect overflow? Adder with Carry Out want to calculate: CarryOut, Result(3:0) <= A(3:0) + B(3:0) this is NOT legal VHDL signal A, B, Result : unsigned(3 downto 0); signal Y5 : unsigned(4 downto 0); signal Co : std_logic; -- Carry out and Result in Y5 Y5 <= ( 0 & A) + ( 0 & B); Result <= Y5( 3 downto 0); Co <= Y5(4); 39 40

11 Adder with Carry In want to calculate:??? <= A(3:0) + B(3:0) + CarryIn signal A, B, Result : unsigned(3 downto 0); signal Y5 : unsigned(4 downto 0); signal CarryIn : std_logic; -- Carry out and Result in Y5 Y5 <= (A & 1 ) + (B & CarryIn); Result <= Y5( 4 downto 1); This gives the correct result User defined integer types - Examples type day_of_month is range 0 to 31; type year is range 0 to 2100; type set_index_range is range 999 downto 100; constant number_of_bits: integer :=32; type bit_index is range 0 to number_of_bits-1; Values of bounds can be expressions, but need to be known when the model is analyzed User-defined enumeration types - Examples type state is (S0, S1); type alu_function is (nop, add, subtract,multiply, divide); type octal_digit is ( 0, 1, 2, 3, 4, 5, 6, 7 ); type mixed is (lf, cr, ht, -, /, \ ); Each value in an enumeration type must be either an identifier or a character literal Floating point types Used to represent real numbers Numbers are represented using a mantissa and an exponent Conform to the IEEE standard 754 or 854 Minimum size of representation that must be supported by the implementation of the VHDL standard: VHDL-2001: 64-bit representation VHDL-87, VHDL-93: 32-bit representation 43 44

12 Real literals - examples E E E e #0.101#E =( ) 2 5 8#0.4#E = (4 8-1 ) #0.a5#E-8 0.a =( ) 16-8 User-defined floating-point types - Examples type input_level is range to type probability is range 0.0 to 1.0; constant max_output: real := 1.0E6; constant min_output: real := 1.0E-6; type output_range is max_output downto min_output; Physical data types Time values (physical literals) - Examples Types representing physical quantities, such as time, voltage, capacitance, etc. are referred in VHDL as physical data types. TIME is the only predefined physical data type. Value of the physical data type is called a physical literal. Numeric value 7 ns 1 min min us fs Space Unit of time (dimension) 47 48

13 Unit Base Unit fs Derived Units ps ns us ms sec min hr Units of time Definition femtoseconds (10-15 seconds) picoseconds (10-12 seconds) nanoseconds (10-9 seconds) microseconds (10-6 seconds) miliseconds (10-3 seconds) seconds minutes (60 seconds) hours (3600 seconds) User-defined physical types (1) type resistance is range 0 to 1E9 units ohm; kohm = 1000 ohm; Mohm = 1000 kohm; end units resistance; User-defined physical types (2) type length is range 0 to 1E10 units um; -- primary unit: micron mm = 1000 um; -- secondary metric units m = 1000 mm; inch = um; -- secondary English units foot = 12 inch; end units length; T left T right T low T high Attributes of all scalar types first (leftmost) value in T last (rightmost) value in T least value in T greatest value in T type index_range is range 21 downto 11; index_range left = 21 index_range right = 11 index_range low = 11 index_range high =

14 Subtype Defines a subset of a base type values A condition that is used to determine which values are included in the subtype is called a constraint All operations that are applicable to the base type also apply to any of its subtypes -- inheritance Base type and subtype can be mixed in the operations, but the result must belong to the subtype, otherwise an error is generated. Predefined subtypes natural integers 0 positive integers > User-defined subtypes - Examples subtype bit_index is integer range 31 downto 0; subtype input_range is real range 1.0E-9 to 1.0E+12; One-dimensional arrays Examples type controller_state is (initial, idle, active, error); type state_counts_imp is array(controller_state range idle to error) of natural; type state_counts_exp is array(controller_state range idle to error) of natural; type state_counts_full is array(controller_state) of natural;.. variable counters: state_counts_exp;.. counters(active) := 0;.. counters(active) := counters(active) + 1; 55 56

15 One-dimensional array Initialization (1) One-dimensional array Initialization (2) type point is array (1 to 3) of real; constant origin_point : point := (0.0, 0.0, 0.0); variable view_point : point := (10.0, 20.0, 45.0); type coeff_ram_address is integer range 0 to 63; type coef_array is array (coeff_ram_address) of real; variable coeff1: coeff_array := (0 => 1.6, 1=>2.3, 3 to 63 => 0.0); variable coeff2: coeff_array := (0 => 5E-8, 1=>6E3, others => 0.0); variable coeff3: coeff_array := (0 5 6 => 5E-8, 1 2=>6E3, others => 0.0); Multidimensional arrays Example (1) Multidimensional arrays Example (2) type matrix is array (1 to 3, 1 to 3) of real; variable transform: matrix;.. transform(2, 3) := 4.5E3; type symbol is ( a, t, d, h, digit, cr, error); type state is range 0 to 6; type transition_matrix is array (state, symbol) of state; variable transform: transition_matrix;.. transform(5, d ) := 6; 59 60

16 Array Attributes A left(n) left bound of index range of dimension N of A A right(n) right bound of index range of dimension N of A A low(n) lower bound of index range of dimension N of A A high(n) upper bound of index range of dimension N of A A range(n) index range of dimension N of A A reverse_range(n) index range of dimension N of A A length(n) length of index range of dimension N of A A ascending(n) length of index range of dimension N of A Array Attributes - Examples type A is array (1 to 4, 31 downto 0); A left(1) = 1 A right(2) = 0 A low(1) = 1 A high(2) = 31 A range(1) = 1 to 4 A length(2) = 32 A ascending(2) = false Predefined Unconstrained Array Types Using Predefined Unconstrained Array Types Predefined bit_vector array of bits string array of characters Defined in the ieee.std_logic_1164 package: std_logic_vector array of std_logic subtype byte is bit_vector(7 downto 0);. variable channel_busy : bit_vector(1 to 4);. constant ready_message :string := ready ;. signal memory_bus: std_logic_vector (31 downto 0); type std_logic_vector is array (natural <>) of std_logic; 63 64

17 User-defined Unconstrained Array Types type sample is array (natural range <>) of integer;. variable long_sample is sample(0 to 255);. constant look_up_table_1: sample := (127, -45, 63, 23, 76);. constant look_up_table_2: sample := (1=>23, 2=>100, 3=>-16, 4=>11); Array Attributes Most attributes are not synthesizable Useful for writing simulation code These attributes can be determined statically subtype WORD is std_logic_vector(7 downto 0); WORD range 7 downto 0 WORD reverse_range 0 to 7 WORD length 8 WORD high 7 WORD low 0 WORD left 7 WORD right Array attributes Automatic Resource Sharing Assign Thigh the highest and Tlow the lowest bit value in word: signal Thigh, Tlow: std_logic; signal Word1: Word; Thigh <= Word1(Word high); Tlow <= Word1(Word low); PROCESS(OP, PC) BEGIN IF OP = skip THEN PC <= PC + 2; -- Skip next instruction ELSE PC <= PC + 1; -- Normal sequence END IF; END PROCESS; PROCESS(OP, PC) VARIABLE bump_val: integer RANGE 1 TO 2; BEGIN IF OP = skip THEN bump_val := 2; ELSE bump_val := 1; END IF; PC <= PC + bump_val; END PROCESS; 2 PC 2 1 PC

18 Automatic Resource Sharing Example: Resource sharing PROCESS(A, B, C, D, SEL) BEGIN IF SEL = '0' THEN SUM <= A + B - C; ELSE SUM <= D + A + B; END IF; END PROCESS; Share 69 PROCESS(A, B, C, D, SEL) VARIABLE temp: std_logic_vector(2 DOWNTO 0); BEGIN temp := A + B; IF SEL = '0' THEN SUM <= temp - C; ELSE SUM <= temp + D; END IF; END PROCESS; process(opsel, A, B, C, D, E, F, G, H) begin case OpSel is when 00 => Z <= A + B; when 01 => Z <= C + D; when 10 => Z <= E + F; when 11 => Z <= G + H; when others => Z <= (others => X ) ; end case; end process; How many adders are inferred? 70 To Guarantee Resource Sharing Create a function called Mux4 X <= Mux4(OpSel, A, C, E, G); Y <= Mux4(OpSel, B, D, F, H); Z <= X + Y; Function is NOT a component more on functions and procedures later Example: Resource sharing process(opsel, A, B, C, D, E, F, G, H) begin if (OpSel = 00 ) then Z <= A + B; end if; if (OpSel = 01 ) then Z <= C + D; end if; if (OpSel = 10 ) then Z <= E + F; end if; if (OpSel = 11 ) then Z <= G + H; endif; end process; How many adders are inferred? This guarantees one adder is inferred 71 72

19 Example: Resource sharing process(opsel, A, B, C, D, E, F, G, H) begin if (OpSel = 00 ) then Z <= A + B; elsif (OpSel = 01 ) then Z <= C + D; elsif (OpSel = 10 ) then Z <= E + F; elsif (OpSel = 11 ) then Z <= G + H; endif; end process; How many adders are inferred? Functions and Procedures Functions take parameters and return a value In procedures, the return value is on the list of arguments For most CAD tools, functions are synthesizable expand them in line Procedures are not synthesizable Functions, procedures are useful for type conversion, bus resolution,... often appear in packages testbenches Functions Example 1 Maj3 Declared by specifying: 1)The name of the function 2)The input parameters, (if any), and their type 3)The type of the returned value 4) Any declarations required by the function itself 5)An algorithm for the computation of the returned value Declaration: function MAJ3(X: STD_LOGIC_VECTOR(0 to 2)) return STD_LOGIC is begin return (X(0) and X(1)) or (X(0) and X(2)) or (X(1) and X(2)); end MAJ3; Use: C(1) <= MAJ3(A); Where to declare? Can be done within any declarative portion (architecture, process etc.) 75 76

20 Wired AND Resolution Function type TS is ( 0, 1, Z ); type TSV is (NATURAL range <>) of TS; function WIRED_AND(S: TSV) return TS is variable RESOLVED_VALUE := Z ; begin for I in S range loop if S(I) = 0 then RESOLVED_VALUE := 0 ; exit; elsif S(I) = 1 then RESOLVED_VALUE := 1 ; end if; end loop; return RESOLVED_VALUE; end WIRED_AND; Procedure Declared by specifying 1) The name of the procedure 2) The input and output parameters, (if any) and their types 3) Any declarations required by the procedure itself 4) An algorithm Difference between functions and procedures: Functions evaluate to a value Procedures have input and output parameters Example Example (contd.) procedure ONES_AND_ZEROS_CNT (variable X: in STD_LOGIC_VECTOR(0 to 2); variable N_ONES, N_ZEROS: out STD_LOGIC_VECTOR(0 to 1)) is variable NUM1: INTEGER range 0 to 3 := 0; variable NUM0: INTEGER range 0 to 3 := 0; begin for I in 0 to 2 loop if X(I) = 1 then NUM1 := NUM1 + 1; else NUM0 := NUM0 + 1; end if; end loop; case NUM1 is when 0 => N_ONES := 00 when 1 => N_ONES := 01 when 2 => N_ONES := 10 when 3 => N_ONES := 11 end case; case NUM0 is when 0 => N_ZEROS := 00 when 1 => N_ZEROS := 01 when 2 => N_ZEROS := 10 when 3 => N_ZEROS := 11 end case; end ONES_AND_ZEROS_CNT; 79 80

21 Usage process(inp) variable N1, N0: STD_LOGIC_VECTOR(0 to 1); variable Z: STD_LOGIC_VECTOR(0 to 2); begin Z := INP; ONES_AND_ZEROS_CNT(Z, N1, N0); OUT1 <= N1; OUT0 <= N0; end process; A variable is declared within a block, process, procedure, or function, and is updated immediately when an assignment statement is executed. Useful for functions and procedures. Procedures are usually not synthesizable Functions are synthesizable: expanded in-line Example: Type Conversion type byte is array(7 downto 0) of bit; procedure byte_to_integer (ib: IN byte; oi: out integer) is variable result: integer:= 0; begin for I in 0 to ib range loop if ib(i) = 1 then result := result + 2**i; end if; end loop; oi := result; end byte_to_integer; variable abyte: byte; variable anint: integer; byte_to_integer(abyte,anint); 81 82

Digitaalsüsteemide disain

Digitaalsüsteemide disain IAY 0600 Digitaalsüsteemide disain VHDL discussion Verification: Testbenches Design verification We want to verify that our design is correct before the target PLD is programmed. The process performed

More information

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu Sept 13, 2006 Lecture 3: Basic VHDL constructs Signals, Variables, Constants VHDL Simulator and Test benches Types Reading: Ashenden

More information

Inthis lecture we will cover the following material:

Inthis lecture we will cover the following material: Lecture #8 Inthis lecture we will cover the following material: The standard package, The std_logic_1164 Concordia Objects & data Types (Signals, Variables, Constants, Literals, Character) Types and Subtypes

More information

CprE 583 Reconfigurable Computing

CprE 583 Reconfigurable Computing Recap Moore FSM Example CprE / ComS 583 Reconfigurable Computing Moore FSM that recognizes sequence 10 0 1 0 1 S0 / 0 S1 / 0 1 S2 / 1 Prof. Joseph Zambreno Department of Electrical and Computer Engineering

More information

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used. Filename= ch5.doc 5. 0 VHDL OPERATORS There are seven groups of predefined VHDL operators: 1. Binary logical operators: and or nand nor xor xnor 2. Relational operators: = /= < >= 3. Shifts operators:

More information

Introduction to VHDL. Main language concepts

Introduction to VHDL. Main language concepts Introduction to VHDL VHSIC (Very High Speed Integrated Circuit) Hardware Description Language Current standard is IEEE 1076-1993 (VHDL-93). Some tools still only support VHDL-87. Tools used in the lab

More information

BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS. Lecture 7 & 8 Dr. Tayab Din Memon

BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS. Lecture 7 & 8 Dr. Tayab Din Memon BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS Lecture 7 & 8 Dr. Tayab Din Memon Outline Data Objects Data Types Operators Attributes VHDL Data Types VHDL Data Objects Signal Constant Variable File VHDL Data

More information

LANGUAGE VHDL FUNDAMENTALS

LANGUAGE VHDL FUNDAMENTALS LANGUAGE VHDL FUNDAMENTALS Introduction Entities and architectures Sentences and processes Objects Data types and operands Authors: Luis Entrena Arrontes, Celia López, Mario García, Enrique San Millán,

More information

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification Part II

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification Part II Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification Part II Ahmed Abu-Hajar, Ph.D. abuhajar@digitavid.net Digitavid, Inc San Jose, CA VHDL Lexical Description Code

More information

ECE 545 Lecture 4. Simple Testbenches. George Mason University

ECE 545 Lecture 4. Simple Testbenches. George Mason University ECE 545 Lecture 4 Simple Testbenches George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 2.2.4, Testbenches 2 Testbenches ECE 448 FPGA and ASIC Design with VHDL 3 Testbench

More information

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 8, 2006 Midterm Average: 70 Lecture 16: Midterm Solutions Homework 6: Calculator Handshaking HW 6: Due Wednesday, November

More information

Lecture 38 VHDL Description: Addition of Two [5 5] Matrices

Lecture 38 VHDL Description: Addition of Two [5 5] Matrices Lecture 38 VHDL Description: Addition of Two [5 5] Matrices -- First, write a package to declare a two-dimensional --array with five elements library IEEE; use IEEE.STD_LOGIC_1164.all; package twodm_array

More information

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1 Lecture 1: VHDL Quick Start Digital Systems Design Fall 10, Dec 17 Lecture 1 1 Objective Quick introduction to VHDL basic language concepts basic design methodology Use The Student s Guide to VHDL or The

More information

Design units can NOT be split across different files

Design units can NOT be split across different files Skeleton of a Basic VHDL Program This slide set covers the components to a basic VHDL program, including lexical elements, program format, data types and operators A VHDL program consists of a collection

More information

Contents. Appendix D VHDL Summary Page 1 of 23

Contents. Appendix D VHDL Summary Page 1 of 23 Appendix D VHDL Summary Page 1 of 23 Contents Appendix D VHDL Summary...2 D.1 Basic Language Elements...2 D.1.1 Comments...2 D.1.2 Identifiers...2 D.1.3 Data Objects...2 D.1.4 Data Types...2 D.1.5 Data

More information

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 6, 2006 Classes November 6 and 8 are in 429 Dana! Lecture 15: Homework 5: Datapath How to write a testbench for synchronous

More information

Introduction to the VHDL language. VLSI Digital Design

Introduction to the VHDL language. VLSI Digital Design Introduction to the VHDL Hardware description language 1. Introduction 2. Basic elements 3. Scalar data types 4. Composed data types 5. Basic constructs (system definition) 6. Data flow description level

More information

Basic Language Constructs of VHDL

Basic Language Constructs of VHDL Basic Language Constructs of VHDL Chapter 3 1 Outline 1. Basic VHDL program 2. Lexical elements and program format 3. Objects 4. Data type and operators Chapter 3 2 1. Basic VHDL program Chapter 3 3 Design

More information

CDA 4253 FPGA System Design VHDL Testbench Development. Hao Zheng Comp. Sci & Eng USF

CDA 4253 FPGA System Design VHDL Testbench Development. Hao Zheng Comp. Sci & Eng USF CDA 4253 FPGA System Design VHDL Testbench Development Hao Zheng Comp. Sci & Eng USF art-4- > 70% projects spent > 40% time in verification 2 Validation, Verification, and Testing Validation: Does the

More information

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\ CSCI 250 - Lab 3 VHDL Syntax Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\ Objectives 1. Learn VHDL Valid Names 2. Learn the presentation of Assignment and Comments 3. Learn Modes, Types, Array,

More information

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level

More information

VHDL Structural Modeling II

VHDL Structural Modeling II VHDL Structural Modeling II ECE-331, Digital Design Prof. Hintz Electrical and Computer Engineering 5/7/2001 331_13 1 Ports and Their Usage Port Modes in reads a signal out writes a signal inout reads

More information

Outline CPE 626. Advanced VLSI Design. Lecture 4: VHDL Recapitulation (Part 2) Signals. Variables. Constants. Variables vs.

Outline CPE 626. Advanced VLSI Design. Lecture 4: VHDL Recapitulation (Part 2) Signals. Variables. Constants. Variables vs. CPE 626 Lecture 4: VHDL Recapitulation (Part 2) Aleksandar Milenkovic http://www.ece.uah.edu/~milenka http://www.ece.uah.edu/~milenka/cpe626-04f/ milenka@ece.uah.edu Assistant Professor Electrical and

More information

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University ECE 545 Lecture 8 Data Flow Description of Combinational-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 7, Combinational Circuit Design:

More information

ECE 545 Lecture 9. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. George Mason University

ECE 545 Lecture 9. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. George Mason University ECE 545 Lecture 9 Modeling of Circuits with a Regular Structure Aliases, Attributes, Packages George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapters 14.5 For Generate

More information

Data types defined in the standard package

Data types defined in the standard package Data Types Each data object has a type associated with it. The type defines the set of values that the object can have and the set of operation that are allowed on it. Data types defined in the standard

More information

Chapter 6 Combinational-Circuit Building Blocks

Chapter 6 Combinational-Circuit Building Blocks Chapter 6 Combinational-Circuit Building Blocks Commonly used combinational building blocks in design of large circuits: Multiplexers Decoders Encoders Comparators Arithmetic circuits Multiplexers A multiplexer

More information

Lecture 3 Introduction to VHDL

Lecture 3 Introduction to VHDL CPE 487: Digital System Design Spring 2018 Lecture 3 Introduction to VHDL Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 Managing Design

More information

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level

More information

Outline. CPE/EE 422/522 Advanced Logic Design L07. Review: JK Flip-Flop Model. Review: VHDL Program Structure. Review: VHDL Models for a MUX

Outline. CPE/EE 422/522 Advanced Logic Design L07. Review: JK Flip-Flop Model. Review: VHDL Program Structure. Review: VHDL Models for a MUX Outline CPE/EE 422/522 Advanced Logic Design L07 Electrical and Computer Engineering University of Alabama in Huntsville What we know How to model Combinational Networks in VHDL Structural, Dataflow, Behavioral

More information

ECE 545 Lecture 7. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. Mixing Design Styles. George Mason University

ECE 545 Lecture 7. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. Mixing Design Styles. George Mason University ECE 545 Lecture 7 Modeling of Circuits with a Regular Structure Aliases, Attributes, Packages Mixing Design Styles George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapters

More information

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs Logic and Computer Design Fundamentals VHDL Part Chapter 4 Basics and Constructs Charles Kime & Thomas Kaminski 24 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Overview

More information

EEL 4783: Hardware/Software Co-design with FPGAs

EEL 4783: Hardware/Software Co-design with FPGAs EEL 4783: Hardware/Software Co-design with FPGAs Lecture 9: Short Introduction to VHDL* Prof. Mingjie Lin * Beased on notes of Turfts lecture 1 What does HDL stand for? HDL is short for Hardware Description

More information

Subprograms, Packages, and Libraries

Subprograms, Packages, and Libraries Subprograms, Packages, and Libraries Sudhakar Yalamanchili, Georgia Institute of Technology ECE 4170 (1) function rising_edge (signal clock: std_logic) return boolean is declarative region: declare variables

More information

Review. VHDL in Action. This week. Lexical Elements. Literals. More Literals. Concurrent statements Conditional and selected signal assignments

Review. VHDL in Action. This week. Lexical Elements. Literals. More Literals. Concurrent statements Conditional and selected signal assignments Review Concurrent statements Conditional and selected signal assignments Cannot be placed inside a process Equivalent to some process Assert statement Debugging VHDL in Action Chapter 3 Chapter 5, Section

More information

Basic Language Concepts

Basic Language Concepts Basic Language Concepts Sudhakar Yalamanchili, Georgia Institute of Technology ECE 4170 (1) Describing Design Entities a sum b carry Primary programming abstraction is a design entity Register, logic block,

More information

Specifying time in VHDL

Specifying time in VHDL Computer System Structures cz:struktury počítačových systémů Lecturer: Richard Šusta richard@susta.cz, susta@fel.cvut.cz, +420 2 2435 7359 Version: 1.0 ČVUT-FEL in Prague, CR subject A0B35SPS Specifying

More information

VHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit.

VHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit. VHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit. Its main applications include synthesis of digital circuits onto CPLD/FPGA (Complex Programmable

More information

Hardware Modeling. VHDL Syntax. Vienna University of Technology Department of Computer Engineering ECS Group

Hardware Modeling. VHDL Syntax. Vienna University of Technology Department of Computer Engineering ECS Group Hardware Modeling VHDL Syntax Vienna University of Technology Department of Computer Engineering ECS Group Contents Identifiers Types & Attributes Operators Sequential Statements Subroutines 2 Identifiers

More information

ECOM 4311 Digital Systems Design

ECOM 4311 Digital Systems Design ECOM 4311 Digital Systems Design Eng. Monther Abusultan Computer Engineering Dept. Islamic University of Gaza Page 1 Agenda 1. Counters Page 2 Counters - special name of any clocked sequential circuit

More information

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University ECE 545 Lecture 5 Data Flow Modeling in VHDL George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 4, Concurrent Signal Assignment Statements of VHDL 2 Types of VHDL Description

More information

Digital Systems Design

Digital Systems Design IAY 0600 Example: HalfAdder Behavior Structure Digital Systems Design a b Sum Carry 0 0 0 0 0 1 1 0 a b HalfAdder Sum Carry 1 0 1 0 VHDL discussion Dataflow Style Combinational Design 1 1 0 1 a Sum Sum

More information

ECE 3401 Lecture 10. More on VHDL

ECE 3401 Lecture 10. More on VHDL ECE 3401 Lecture 10 More on VHDL Outline More on VHDL Some VHDL Basics Data Types Operators Delay Models VHDL for Simulation VHDL for Synthesis 1 Data Types Every signal has a type, type specifies possible

More information

Introduction to VHDL

Introduction to VHDL Introduction to VHDL Agenda Introduce VHDL Basic VHDL constructs Implementing circuit functions Logic, Muxes Clocked Circuits Counters, Shifters State Machines FPGA design and implementation issues FPGA

More information

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009 2065-15 Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis 26 October - 20 November, 2009 FPGA Architectures & VHDL Introduction to Synthesis Nizar Abdallah ACTEL Corp.2061

More information

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden Synthesis from VHDL Krzysztof Kuchcinski Krzysztof.Kuchcinski@cs.lth.se Department of Computer Science Lund Institute of Technology Sweden March 23, 2006 Kris Kuchcinski (LTH) Synthesis from VHDL March

More information

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

!#$%&&'(')*+%,%-.#'/'.001$$ !"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"!!"#$%&'#()#*+"+#,-."/0110#230#4."50",+"+#)6# 6+-+#(.6+-0#)4475.8)60#0/#.65-0#230#9+**+"+# 2.48).-0#(.6+-0#! 2+"*5."5*:#,."/0110#;)**0! *),".6*:#-.99-0*0"5."+#2+660,.40"5)#;)*)2)#

More information

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library : UNIT I Introduction to VHDL VHDL stands for very high-speed integrated circuit hardware description language. Which is one of the programming languages used to model a digital system by dataflow, behavioral

More information

COE 405 Design Methodology Based on VHDL

COE 405 Design Methodology Based on VHDL COE 405 Design Methodology Based on VHDL Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Outline Elements of VHDL Top-Down Design Top-Down Design with

More information

ECOM 4311 Digital System Design using VHDL. Chapter 7

ECOM 4311 Digital System Design using VHDL. Chapter 7 ECOM 4311 Digital System Design using VHDL Chapter 7 Introduction A design s functionality should be verified before its description is synthesized. A testbench is a program used to verify a design s functionality

More information

Hardware Synthesis. Midia Reshadi. CE Department Science and research branch of Islamic Azad University

Hardware Synthesis. Midia Reshadi. CE Department Science and research branch of Islamic Azad University Hardware Synthesis MidiaReshadi CE Department Science and research branch of Islamic Azad University Email: ce.srbiau@gmail.com Midia Reshadi 1 Chapter 6 Testbenches for Combinational Designs Midia Reshadi

More information

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006 310/1780-10 ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006 VHDL & FPGA - Session 2 Nizar ABDALLH ACTEL Corp. 2061 Stierlin Court

More information

INTRODUCTION TO VHDL ADVANCED COMPUTER ARCHITECTURES. Slides by: Pedro Tomás. Additional reading: - ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC)

INTRODUCTION TO VHDL ADVANCED COMPUTER ARCHITECTURES. Slides by: Pedro Tomás. Additional reading: - ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC) INTRODUCTION TO VHDL Slides by: Pedro Tomás Additional reading: - ADVANCED COMPUTER ARCHITECTURES ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC) Outline 2 Hardware Description Languages (HDL) VHDL Very

More information

VHDL BASIC ELEMENTS INTRODUCTION

VHDL BASIC ELEMENTS INTRODUCTION VHDL BASIC ELEMENTS INTRODUCTION VHDL Basic elements Identifiers Basic identifiers Extended identifiers Data Objects Constant Variable Signal File Data Types Scalar Composite Access File type Identifiers

More information

ECOM4311 Digital Systems Design

ECOM4311 Digital Systems Design ECOM 4311 Digital Systems Design Eng. Monther Abusultan Computer Engineering Dept. Islamic University of Gaza Page 1 Agenda 1. VHDL : Data Types Cont d 2. VHDL : Operators 3. VHDL : Signal Assignments

More information

Verilog HDL is one of the two most common Hardware Description Languages (HDL) used by integrated circuit (IC) designers. The other one is VHDL.

Verilog HDL is one of the two most common Hardware Description Languages (HDL) used by integrated circuit (IC) designers. The other one is VHDL. Verilog HDL is one of the two most common Hardware Description Languages (HDL) used by integrated circuit (IC) designers. The other one is VHDL. HDL s allows the design to be simulated earlier in the design

More information

VHDL Instant. Table of contents. History

VHDL Instant. Table of contents. History VHDL Instant This document aims at giving essential information on VHDL syntax including small examples. It does not provide a complete coverage of the language. History v1.0 2002 Initial version. v1.1

More information

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A JUNE, JULY 2013 Fundamentals of HDL (10EC45) Time: 3hrs Max Marks:100 Note: Answer FIVE full questions, selecting at least TWO questions from each part. PART A Q1.a. Describe VHDL scalar data types with

More information

Review of Digital Design with VHDL

Review of Digital Design with VHDL Review of Digital Design with VHDL Digital World Digital world is a world of 0 and 1 Each binary digit is called a bit Eight consecutive bits are called a byte Hexadecimal (base 16) representation for

More information

ECEN 468 Advanced Logic Design

ECEN 468 Advanced Logic Design ECEN 468 Advanced Logic Design Lecture 26: Verilog Operators ECEN 468 Lecture 26 Operators Operator Number of Operands Result Arithmetic 2 Binary word Bitwise 2 Binary word Reduction 1 Bit Logical 2 Boolean

More information

C-Based Hardware Design

C-Based Hardware Design LECTURE 6 In this lecture we will introduce: The VHDL Language and its benefits. The VHDL entity Concurrent and Sequential constructs Structural design. Hierarchy Packages Various architectures Examples

More information

ENGIN 241 Digital Systems with Lab

ENGIN 241 Digital Systems with Lab ENGIN 241 Digital Systems with Lab (4) Dr. Honggang Zhang Engineering Department University of Massachusetts Boston 1 Introduction Hardware description language (HDL): Specifies logic function only Computer-aided

More information

Digital Systems Design

Digital Systems Design IAY 0600 Digital Systems Design VHDL discussion Dataflow Style Combinational Design Tallinn University of Technology Combinational systems Combinational systems have no memory. A combinational system's

More information

VHDL 200X: The Future of VHDL

VHDL 200X: The Future of VHDL VHDL 200X: The Future of VHDL By Jim Lewis VHDL Training Team Leader VHDL-200X Fast Track jim@synthworks.com Lewis 1 MAPLD 2005 / P255 VHDL-200X: The Future of VHDL Currently the work is being funded through

More information

VHDL Part 2. What is on the agenda? Basic VHDL Constructs. Examples. Data types Objects Packages and libraries Attributes Predefined operators

VHDL Part 2. What is on the agenda? Basic VHDL Constructs. Examples. Data types Objects Packages and libraries Attributes Predefined operators VHDL Part 2 Some of the slides are taken from http://www.ece.uah.edu/~milenka/cpe428-02s/ What is on the agenda? Basic VHDL Constructs Data types Objects Packages and libraries Attributes Predefined operators

More information

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems EE 3610: Digital Systems 1 Lecture 3: Modeling in VHDL VHDL: Overview 2 VHDL VHSIC Hardware Description Language VHSIC=Very High Speed Integrated Circuit Programming language for modelling of hardware

More information

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic CPE 626 Lecture 6: VHDL Synthesis Aleksandar Milenkovic http://www.ece.uah.edu/~milenka http://www.ece.uah.edu/~milenka/cpe626-04f/ milenka@ece.uah.edu Assistant Professor Electrical and Computer Engineering

More information

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents VHDL Testbench Tutorial 1 Contents 1 VHDL Testbench 2 Test Bench Syntax 3 Testbench Example: VHDL Code for Up Down Binary Counter 4 VHDL Testbench code for up down binary counter 5 Testbench Waveform for

More information

Combinational Logic COMB. LOGIC BLOCK. A Combinational Logic Block is one where the outputs depend only on the current inputs

Combinational Logic COMB. LOGIC BLOCK. A Combinational Logic Block is one where the outputs depend only on the current inputs Combinational Logic A Combinational Logic Block is one where the outputs depend only on the current inputs COMB. LOGIC BLOCK A combinational logic block can be implemented using simple gates or lookup

More information

Lecture 9. VHDL, part IV. Hierarchical and parameterized design. Section 1 HIERARCHICAL DESIGN

Lecture 9. VHDL, part IV. Hierarchical and parameterized design. Section 1 HIERARCHICAL DESIGN Lecture 9 VHDL, part IV Hierarchical and parameterized design Section 1 HIERARCHICAL DESIGN 2 1 Dealing with Large Digital System Design 1. Apply hierarchy to the design At the highest level use larger

More information

Control and Datapath 8

Control and Datapath 8 Control and Datapath 8 Engineering attempts to develop design methods that break a problem up into separate steps to simplify the design and increase the likelihood of a correct solution. Digital system

More information

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S.

More information

VHDL And Synthesis Review

VHDL And Synthesis Review VHDL And Synthesis Review VHDL In Detail Things that we will look at: Port and Types Arithmetic Operators Design styles for Synthesis VHDL Ports Four Different Types of Ports in: signal values are read-only

More information

Hardware Description Language VHDL (1) Introduction

Hardware Description Language VHDL (1) Introduction Hardware Description Language VHDL (1) Introduction Digital Radiation Measurement and Spectroscopy NE/RHP 537 Introduction Hardware description language (HDL) Intended to describe circuits textually, for

More information

Lab # 5. Subprograms. Introduction

Lab # 5. Subprograms. Introduction Lab # 5 Subprograms Introduction Subprograms consist of procedures and functions. A procedure can return more than one argument; a function always returns just one. In a function, all parameters are input

More information

Hardware Modeling. VHDL Basics. ECS Group, TU Wien

Hardware Modeling. VHDL Basics. ECS Group, TU Wien Hardware Modeling VHDL Basics ECS Group, TU Wien VHDL Basics 2 Parts of a Design Unit Entity Architecture Configuration Package Package Package Body Library How to create a Design Unit? Interface to environment

More information

VHDL in 1h. Martin Schöberl

VHDL in 1h. Martin Schöberl VHDL in 1h Martin Schöberl VHDL /= C, Java, Think in hardware All constructs run concurrent Different from software programming Forget the simulation explanation VHDL is complex We use only a small subset

More information

Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Output Sum(4 bits) Adder. Output carry(1 bit)

Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Output Sum(4 bits) Adder. Output carry(1 bit) Csc 343 Lab 2 Sep 28. 07 Objective: Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Structure: Input A (4 bits) Input B (4 bit) Adder Output Sum(4 bits) Output carry(1 bit) input cin

More information

Embedded Systems CS - ES

Embedded Systems CS - ES Embedded Systems - 1 - REVIEW Hardware/System description languages VDHL VHDL-AMS SystemC TLM - 2 - VHDL REVIEW Main goal was modeling of digital circuits Modelling at various levels of abstraction Technology-independent

More information

Introduction to VHDL #1

Introduction to VHDL #1 ECE 3220 Digital Design with VHDL Introduction to VHDL #1 Lecture 3 Introduction to VHDL The two Hardware Description Languages that are most often used in industry are: n VHDL n Verilog you will learn

More information

Fixed and Floating Point Packages

Fixed and Floating Point Packages Fixed and Floating Point Packages By Jim Lewis, VHDL Training, jim@synthworks.com David Bishop, Kodak, dbishop@vhdl.org MAPLD September 2005 / P189 1 Copyright 2005 Fixed and Floating Point Packages Fixed

More information

Accellera VHDL By Jim Lewis, SynthWorks VHDL Training

Accellera VHDL By Jim Lewis, SynthWorks VHDL Training Accellera VHDL-2006 By Jim Lewis, VHDL Training jim@synthworks.com MARLUG - Mid-Atlantic Region Local Users Group ANNUAL CONFERENCE - OCTOBER 12, 2006 Johns Hopkins University Applied Physics Lab Laurel,

More information

Very High Speed Integrated Circuit Har dware Description Language

Very High Speed Integrated Circuit Har dware Description Language Very High Speed Integrated Circuit Har dware Description Language Industry standard language to describe hardware Originated from work in 70 s & 80 s by the U.S. Departm ent of Defence Root : ADA Language

More information

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture Assignment Last time Project 4: Using synthesis tools Synplify Pro and Webpack Due 11/11 ning of class Generics Used to parameterize models E.g., Delay, bit width Configurations Configuration specification

More information

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog ECE 2300 Digital Logic & Computer Organization Spring 2018 More Sequential Logic Verilog Lecture 7: 1 Announcements HW3 will be posted tonight Prelim 1 Thursday March 1, in class Coverage: Lectures 1~7

More information

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement Chapter 7 VHDL VHDL - Flaxer Eli Ch 7-1 Process Statement Outline Signal Assignment Statement Variable Assignment Statement Wait Statement If-Then-Else Statement Case Statement Null Statement Loop Statement

More information

COVER SHEET: Total: Regrade Info: 1 (8 points) 2 ( 8 points) 3 (16 points) 4 (16 points) 5 (16 points) 6 (16 points) 7 (16 points) 8 (8 points)

COVER SHEET: Total: Regrade Info: 1 (8 points) 2 ( 8 points) 3 (16 points) 4 (16 points) 5 (16 points) 6 (16 points) 7 (16 points) 8 (8 points) EEL 4712 Midterm 1 Spring 2010 VERSION 1 Name: UFID: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer

More information

Getting Started with VHDL

Getting Started with VHDL Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component Entities can be primitive objects or complex objects Architectures are associated

More information

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule EEU530 EE U530 igital Hardware Synthesis Lecture 11: Prof. Miriam Leeser mel@coe.neu.edu October 18, 2005 Sequential Logic in VHL Finite State Machines in VHL Project proposals due now HW 4 due Wednesday,

More information

VHDL: skaitmeninių įtaisų projektavimo kalba. 2 paskaita Pradmenys

VHDL: skaitmeninių įtaisų projektavimo kalba. 2 paskaita Pradmenys VHDL: skaitmeninių įtaisų projektavimo kalba 2 paskaita Pradmenys Skeleton of a Basic VHDL Program This slide set covers the components to a basic VHDL program, including lexical elements, program format,

More information

VHDL Packages for Synthesis Base Types Standard bit types may be used Typically IEEE 1164 Std. types are used. CPE 528: Session #9

VHDL Packages for Synthesis Base Types Standard bit types may be used Typically IEEE 1164 Std. types are used. CPE 528: Session #9 CPE 528: Session #9 Department of Electrical and Computer Engineering University of Alabama in Huntsville VHDL Packages for Synthesis Base Types Standard bit types may be used Typically IEEE 1164 Std.

More information

Lecture 5: State Machines, Arrays, Loops. EE 3610 Digital Systems

Lecture 5: State Machines, Arrays, Loops. EE 3610 Digital Systems EE 3610: Digital Systems 1 Lecture 5: State Machines, Arrays, Loops BCD to Excess-3 (XS 3 ) Code Converter Example: Fig. 2-53 2 Easier to use one type of code (e.g. XS 3 ) over the other type (e.g. BCD)

More information

CCE 3202 Advanced Digital System Design

CCE 3202 Advanced Digital System Design CCE 3202 Advanced Digital System Design Lab Exercise #2 Introduction You will use Xilinx Webpack v9.1 to allow the synthesis and creation of VHDLbased designs. This lab will outline the steps necessary

More information

VHDL simulation and synthesis

VHDL simulation and synthesis VHDL simulation and synthesis How we treat VHDL in this course You will not become an expert in VHDL after taking this course The goal is that you should learn how VHDL can be used for simulation and synthesis

More information

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit VHDL VHDL Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit VHDL Alternative (Student Generated) Definition Very Hard Digital Logic language VHDL Design

More information

Chapter 2 Synthesizable VHDL for FPGA-Based Devices

Chapter 2 Synthesizable VHDL for FPGA-Based Devices Chapter 2 Synthesizable VHDL for FPGA-Based Devices Abstract This chapter presents a concise introduction to synthesizable VHDL that is sufficient for the design methods and examples given in subsequent

More information

Concurrent Signal Assignment Statements (CSAs)

Concurrent Signal Assignment Statements (CSAs) Concurrent Signal Assignment Statements (CSAs) Digital systems operate with concurrent signals Signals are assigned values at a specific point in time. VHDL uses signal assignment statements Specify value

More information

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013 MARIE CURIE IAPP: FAST TRACKER FOR HADRON COLLIDER EXPERIMENTS 1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013 Introduction to VHDL Calliope-Louisa Sotiropoulou PhD Candidate/Researcher Aristotle University

More information

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning 4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.

More information

VHDL: Code Structure. 1

VHDL: Code Structure. 1 VHDL: Code Structure talarico@gonzaga.edu 1 Mo:va:on for HDL- based design Standard Technology/vendor independent Portable and Reusable talarico@gonzaga.edu 2 Altera s Design Flow (RTL) RTL Generic Boolean

More information