VHDL Flashcards

1
Q

How do we always begin a VHDL code?

A

By defining the libraries that will be used. e.g. library IEEE; use IEEE.std_logic_1164.all;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an entity?

A

The entity is equivalent to the symbol schematic design. It provides the name of the circuit and its interfaces.

(In the digital design project, the signals defined in entity represented signals (or PORTS) that were shared between two codes which were manipulated to get the FPGA to function accordingly).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the architecture represent?

A

The architecture contains the behaviour of the circuit.

architecture structural of circuit1

BEGIN

–code for circuit behaviour, e.g. gate logic

END:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the direction that a port can have?

A

In, out and inout.

  • in = input
  • out = output
  • inout = bidirectional
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where are the ports defined?

A

In the entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a port type?

A

A port type is defined for each port (input/output) in the entity, and describes the format of the information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the standard port type for a single bit?

A

std_logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a std_logic_vector?

A

A standard logic vector is the standard type for a one dimensional array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do we define a standard logic vector which contains 8 bits?

A

std_logic_vector(7 downto 0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the values that a std_logic vector can have?

A
  • ‘U’ - Uninitialised
  • ‘X’ - Forcing unknown
  • ‘0’ - Forcing 0
  • ‘1’ - Forcing 1
  • ‘Z’ - High impedance
  • ‘W’ - Weak Unknown
  • ‘L’ - Weak 0
  • ‘H’ - Weak 1
  • ’-‘ - Don’t care
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is code in the architecture evaluated?

A

In parallel, (concurrency) this means that the statements/process within the architecture are evaluated at the statement rather than one after another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How is a process statement evaluated?

A

When a signal is the sensitivity list has made a transition which causes the process to be evaluated.

This is done sequentially, this means the statements are evaluated one after another like in software programming e.g. in C or python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What do we use to represent a wire?

A

signal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is meant by a structural coding style?

A

Structural is a label that helps to idenitfy the coding style within the architecture.

The structural coding style refers to describing a design using module instances, such as lower-level building blocks like AND gates and flip-flops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a behavioural coding style?

A

The architecture is defined to be structural.

This means that the code within the architecture uses only process statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a sensitivity list?

A

The sensitivity list specified the set of objects (input, signals) that force the process statement to be evaluated. This occurs after a transition on a signal in the sensitivity list.

17
Q

What is a the difference between a signal and a variable?

A

Variable is an object that can hold a value, they are similar to signals but they do not have direct physical significance.

The main difference is that a signal is an object with past history of values, while a variable is an object with a single current value.

Variables can only be used within processes, e.g. to create an algorithm within a process, whereas signals are more flexible.

Variables are defined := and signals are defined using : only

18
Q

What is the two-process rule?

A

One combinatorial and one sequential process in one file.

19
Q

What is a coding difference between a combinational process and a sequential process?

A

A combinational process does not require a clock, it would only require the relevant signals or ports in the sensitivity list.

A sequential process requires a clock, this means that the sensitivity list includes clk

20
Q

What can case statements be used for?

A

To generate multiplexers

To create a FSM

21
Q

What is an inferred latch?

A

Latches are inferred in VHDL by using an IF statement without its matching ELSE. The signal is held at this value since no other instruction is given hence the signal is latched.

22
Q

What is the issue with inferred latches?

A

They can causes issues when synthesising e.g. in FPGA design.

They can impact timing

23
Q

How can we remove latches?

A

We can must assign both values of the if-else statement.

We can assign a statement to be a value other than 1/0 such as:

in a CASE statement

when others => null;

24
Q

Describe a hierarchical design

A
  • Larger components are built using smaller components.
  • Component declaration followed by component instantiation.
  • Internal signals are used to connect components together.
25
Q

What kind of logic is a register?

A

Sequential