Part 1 - Topic 1 - Introduction to Logic Design with SystemVerilog Flashcards
Write out Decimal 44 using 20 bits as a SV constant.
20’d44
Write out Hexadecimal 123 using 12 bits as a SV constant.
12’h123
What can and cannot continuous-assignment statements model?
Limited to modeling level-sensitive behaviour.
They cannot model an element that has signal pulse edge-sensitive behaviour, such as a flip-flop.
What is a ‘majority’ circuit? What main repetitive algorithm does it use?
And what is its circuit?
A majority circuit outputs ‘1’ if a majority of the bits of an input word are ‘1’.
The model Majority, uses a for loop to count the input bits which are ‘1’.
What is a repeat loop?
What is an example code?
A repeat loop is used in the fragment of code below to initialise a memory array:
FSMs: what is the enum type and what is it used for?
An enumerated (enum) type defines a set of named values.
The named values are defaulted to integers and linearly increase from 0 up until the last value defined.
e.g. enum { red, green, blue, yellow, white, black } Colors;
In the above example by default variable will get the default value of 0,1,2,3,4,5 respectively from red.
Values can be manually assigned and a name without a value is automatically assigned an increment of the value of the previous name.
How do you technically add parameters besides input and output to a module?
How does instantiation of the module change the default value or use the default value?
In separate brackets with an # in front, a parameter can be defined using the keyword parameter followed by the parameter name and value.
The value by passing in the value through the #() brackets, the the parmeter name can be specified but it doesn’t have to be.
What is a buffer?
A digital buffer is an electronic circuit element that is used to isolate the input from the output, providing either no voltage or a voltage that is the same as the input voltage.
In other words, it either gives the input as the output or it gives a high impedance output.