TSTE12

Handin exercises 2024 part 2


241001 10:35 Coding question C has a small change in the first example, it should increase the count value to "011"

Solve the handin tasks individually! No cooperation with anyone else!

Submit all Theory question answers in one submission, using the comment field of the submission system. Indicate answers using one line per question, indicating which question (A-D) and which of the multiple choices (1-4) that is your answer to each question.

To pass on the handin exercises it is required to reach 9 correct exercises of 12 on each of theory and code exercises. The handins are divided into 3 sets of questions with 4 points of theori and 4 points of coding on each. Read closely the instructions on the handin main page!

Note the time schedule!
Handin exercises must be in place at latest by the deadline on the given date. Use the commands "module load courses/TSTE12 ; TSTE12handin" to open a shell window to work from.

Handin part 2 is due by Monday 7 October 2024 at 23.30!

The results will be available in the lisam course room.

Note:
   Read the instructions at the main page!!
   Ask if any difficulties or uncertainty!!

Good luck!


Teori A

What is WRONG regarding signals in VHDL? 1) Signals can be defined inside architecture declaration area
2) Entity ports are signals
3) Signals can be assigned values from constants
4) Signals are always assigned a value at simulation start



Theory B

How many different architectures can be declared for an entity? 1) 1
2) 2
3) 16
4) no defined upper limit



Theory C

Which one is not a predefined array attribute in the VHDL language? 1) 'first
2) 'left
3) 'length
4) 'low



Theory D

What is WRONG regarding FPGA hardware? 1) Most FPGA:s are built on look-up tables and flipflops
2) FPGA:s often support a different internal clock frequency
3) FPGA:s contain a microprocessor that is running the VHDL code
4) FPGA:s often include dedicated multipliers structures



Exercise Code A

   source file: INL2_KA.vhdl   Name of the source file.
        Entity: INL2_KA        Name of the entity
  architecture: KA             Name of the architecture
        Inputs: D              data in,  bit
                R              data in,  bit
                C              data in,  bit
       Outputs: Q              data out, bit_vector(6 downto 2) 


     Behaviour: Create a negative edge trigged resettable shift register.
                When there is a falling edge on C and R='1' then set Q to
                "00000". If there is a falling edge on C and R='0' then
                left shift Q one step and put input from D into
                rightmost position in Q.

       Example: Q="10101", R='1', falling edge on C => Q="00000"
                Q="00100", R='0', D='1', falling edge on C => Q="01001"


Exercise Code B

   source file: INL2_KB.vhdl   Name of the source file
        Entity: INL2_KB        Name of the entity
  architecture: KB             Name of the architecture
        Inputs: D              data in, bit_vector(2 to 4)
                C              data in, bit
                R              data in, bit
       Outputs: Q              data out, bit_vector(2 to 4)

      Behavour: Create a 3-bit positive edge triggered register
                with asynchronous reset. If R='1' then set Q to "000".
                If there is a rising edge on C and R='0' then copy
                the value on D to Q.
   
       Example: R='1' => Q="000"
                R='0', D="011", rising edge on C => Q="011"


Exercise Code C

   source file: INL2_KC.vhdl   Name of the source file
        Entity: INL2_KC        Name of the entity
  architecture: KC             Name of the architecture
        Inputs: C              data in, bit
                R              data in, bit
       Outputs: Q              data out, std_logic_vector(3 downto 1)

     Behaviour: Create a positive edge triggered 3 bit counter with
                synchronous reset. If rising edge on C and R='1' then
                Q="000". If a rising edge on C, and R='0' then
                increment Q by 1. Incrementing "111" generates "000".

       Example: R='0',Q="010",rising edge on C => Q="010"Q="011"
                R='1', rising edge on C => Q="000"
                R='0',Q="110",rising edge on C => Q="111"


Exercise Code D

   source file: INL2_KD.vhdl   Name of the source file
        Entity: INL2_KD        Name of the entity
  architecture: KD             Name of the architecture
        Inputs: A              data in,  std_logic
                B              data in,  std_logic
       Outputs: Y              data out, std_logic
   

      Behavour: Create a 2-input OR gate where the output strength
                (use of 0/1, L/H or X) is based on the input strength.
                If both A and B have strong values ('0' or '1') then
                output a '1' or '0' that match an or function.
                If one or more inputs have a 'L' or 'H' and the other
                input has a value of '0', '1', 'L', or 'H' then output
                a 'L' or 'H', where 'L' is seen as a logic 0, and 'H'
                is seen as a logic 1.
                If any of the inputs are not '0', '1', 'L' or 'H' then
                output 'X'.
   
       Example: A='1', B='0' => Y='1'
                A='U', B='1' => Y='X'
                A='L', B='0' => Y='L'