Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3.Short answer questions. (a) Provide 2 examples of a composite data type (give

ID: 3745739 • Letter: 3

Question

3.Short answer questions. (a) Provide 2 examples of a composite data type (give the type name and a literal example) (b) Provide 2 examples of an enumerated scalar data type (give example) the type name and a literal (c) Provide 2 examples of a numeric scalar data type (give the type name and a literal example) (d) List 5 valid std_logic values and describe what each value represents (e) What is the definition of synthesis. (f) Describe where signals and variables can be declared and indicate when each one is updated

Explanation / Answer

3.a) Any data type that can be developed with the help of primitive data types and other composite types can be defined as composite data type

Exapmles of composite data type are - Array, Matrix.


An array is a collection or ordered set of tokens of any data type, where all the elements must be of same type. e.g. - {3,6,4} it is an array of integers.

Matrix is more specialized composite data type than array. Matrices are represented using square brackets. Commas are used to separate the elements of a row and semicolons are used to separate rows. e.g. - "[10,20,30,40;50,60,70,80 ]" represents 2 * 4 integer matrix, i.e an integer matrix having 2 rows and 4 columns.

b) An Enumerated scalar data type is a data type whose domain values are given in an ordered list of distinct scalar values and who's operations are equality and assignment.

e.g. -  enum {ON,OFF } mem;

Here, a variable, mem of enum type is defined that can have any value from the two enumerated constant values, ON and OFF. Usually, the values of first enumeration constant is zero and it will be increased in sequence, i.e. here, ON = 0, and OFF = 1. We can also assign explicit constant values in enumeration as follows :

Here, MON = 10, and the rest of the enumerated scalar constants will have values in increasing sequence : i.e. TUE = 11, WED = 12, THU = 13. Variable day can have any of these enumerated values.

c) A Data type that holds a single data item is called as scalar data type (int, float, char, double etc). A numeric scalar data type is a scalar data type that stores numeric value on which different arithmetic operations can be performed. e.g. - int a = 100;

d) std_logic is the industry standard type for VHDL. 5 std_logic values with their descriptions are as follows -

'U' - Uninitialized , the signal has not been set or initialized.

'X' - Unknown.

'0' - logic 0.

'1' - logic 1.

'Z' - High impedence.

'-' - Don't care.

e)  Synthesis is a process using which a circuit design behvaior which is modelled using HDL, can be converted into a design implementation consisting of logic gates, with the help of a software tool or computer programming called a synthesis tool, e.g. - synthesis of HDLs, including Verilog VHDL.

f) In Verilog, a signal or variable can be declared using:

(1) wire or reg and (2) always or assign

e.g. -, a variable can be declared as - :
reg X;
always X <= 1;
It is Non Blocking procedural assignment, which is possible only inside an initial statement.

A signal can be declared as:
wire m;
assign m=1;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote