{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw3 - constant K:integer:= 8142301000 constant pi:real:=...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
C – 302 Homework Assignment for Week 3 Q1 (i) Declare a constant e of floating point type and initialize it to 2.732 (ii) Declare an array of dimension 6 each of whose elements is an integer between 5 and 10 (iii) Declare a variable TODAY whose value can be any of MON,TUE,WED, THU,FRI. Declare the type as a subtype of DAY_OF_WEEK (iv) Declare a 10-dimensional array each of whose elements is a BIT and initialise it so that the first and seventh elements are ‘1’ and others are ‘0’ (v) Set up a physical type RESISTANCE whose base unit is OHM and the highest value is 5 MEGOHMS (vi)Declare a 6-dimensional array each of whose elements is a std_logic type all initialized to ‘U’ except the last element which is ‘1’ (vi) Declare a character string initialized to GOOD MORNING Q2 Detect the errors and suggest plausible corrections in the following
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: constant K:integer:= 8142301000; constant pi:real:= 3.1415926; variable done:BIT:=0; signal databus:bit_vector(0 to 7):=”UUUUUUUU”; Q3 What are the predefined array types in VHDL? In ieee library? Q4. Using Boolean identities, show that xor operator is associative Q5. Using Boolean identities show that nand and nor operators are not associative Q6 Derive an expression of (a xnor b) nand c in terms of and, or and not operators Q7. State whether the following are true or false: (i) (‘1’ , ‘0’ , ‘1’) < = (‘1’ , ‘1’ , ‘0’) (ii) (false, true , false) > (false , false , false) (iii) “bat” > “batch” (iv) (sun, tue, fri) > (mon, mon, thu) Q8. Evaluate: (i) “101011” sra 3 (ii) “01110110” rol -2 (iii) (false, true, true, true) sll 2 (iv) (-23) mod 5 (v) (-41) rem (-7)...
View Full Document

{[ snackBarMessage ]}