3c213vhdl tutorial sheets (2)
TRANSCRIPT
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
1/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial-1
Q.1) Discuss briefly about different types of architecture with
help o an example.
Q.2) Explain Mixed Style of Architecture.
Q.3) What is the difference between package declaration and
package body.
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
2/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial-2
Q.1 ) Write the code in 3 different styles Behavioral, Dataflow
& Structural for 2 to 1 Mux.
Q.2) Write down the truth table, entity declaration and behavioral/dataflowarchitecture for the 2-4 decoder.
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
3/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial-3
Q. Which of the following are valid VHDL basic identifiers? Of
the invalid identifiers why are they invalid?i. last_item
ii. prev item
iii. value-1
iv. buffer
v. element#5
vi. _control
vii. 93_999
viii. entry_
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
4/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE ANDTECHNOLOGY
VHDL Tutorial-4
Q.1: Rewrite the following decimal literals as hexadecimal
literals:
(i) 1(ii) 46(iii) 512.0(iv) 0.25
Q.2: What decimal numbers are represented by the following
literals:
(i) 8#4#(ii) 16#2C#(iii) 2#1111_1010#(iv) 2.5e5(v) 2#1#E10(vi) 2#0.101#
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
5/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial-5
Q.1: What is the difference between 16 #ABCD# and X ABCD
?
Q.2: Express the following octal and hexadecimal bit string as
binary bit string:
(i) o 777 (iii) O 1_456
(ii) O 346 (iv) X 0000_0001
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
6/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial -6
Q1. WAP for a simple Heater Thermostat. The device can be
modelled as an entity with two integer input. One that specifies
the desire temperature and another that is connected to a
Thermometer and one Boolean output that turn a Heater on
and off. The Thermostat turns the Heater on if the measured
temperature falls below two degree less than the desire
temperature and turns the heater off if the measured
temperature rises above two degree greater than the desiretemperature.
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
7/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial -7
Q1. Write constant declaration for the number of bit in a 32 bit
word and for the number PI = 3.14159
Q2. Write variable declarations for a counter initialize to 0; a
status flag used to indicate whether a module is busy; and a
standard logic value used to store a temporary result.
Q3. Given the subtype declaration:
subtype pulse_range is time_range 1 millisecond to 100
millisecond
subtype word_index is integer range 31 downto 0
What are the values of left , right , low , high and ascending
attributes of each of these subtypes.
Q4. Given the type declaration:
type state is(off,standby,active1,active2);
What are the values of
state pos (standby)
state succ (active2)
state val (2)
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
8/10
state pred (active1)
state leftof (off)
state rightof (off)
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial -8
Q1. Write a wait statement that suspends the process until the
signal ready changes to 1 or until a maximum of 6 milliseconds
has left.
Q2. Write a wait statement that suspends a process until the
signal has changes from 1 to 0 while an enable signal is 1.
Q3. Write down the difference between signal and a variable.
Q4. Discuss data types and data objects.
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
9/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial -9
Q1. WAP for a swapper that has one input and one output part
each of which is a bit_vector of subtype halfword . Declared
subtype halfword is bit_vector(0 to 15) range attribute to
determine the index of the array.
Q2. WAP for n-inputs AND gate.
-
8/3/2019 3c213VHDL Tutorial Sheets (2)
10/10
AMITY UNIVERSITY, UTTER PRADESH
AMITY SCHOOL OF SCIENCE AND
TECHNOLOGY
VHDL Tutorial -10
Q1. Difference between Transport delay and Inertial delay ?
Also write their applications?
Q2. WAP to count number of 1s in a given bit vector?