Lab on Arrays
Lab on Arrays
1)Declare enumerated type variable and assign it a value from Monday to Sunday. Display first,
last values also print total elements of the enumerated type variable. Declare two variables a and
b with logic and bit respectively. Assign b value to a. Print both a and b.
2) Implement Full Adder using always_comb, Model D latch using always _latch and DFF using
always_ff. Write a task to count the number of 1’s in a binary word.
3) Write a code to multiply a loop variable by 2 starting from 1 to 25. Use break and continue in
the loops to control the loop flow and print statements for the result.
4) Add 50 integer values at random locations (between 1 to 100) of an integer associative array.
Check value at index 2 and 45 exists..?
Print the value at first index along with index.
Print the value at last index along with index.
Check the array size.
Delete 5th, 10th and 15th index if they exists..
Print array size again.
6) Declare the packed structure for the following format. Display the part select [24:13].