Question



Exercise 3.24: Legal Assignments #1 Confirm that the statements below are legal (see main causes of mistakes in section 3.19)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

All the below given statements are legal and the reasons are as follows :

a) s1 variable is bit type i.e. of 1 bit and it is assigned to the MSB of s2 variable that is legal, 1 bit assigned to 1 bit variable.

b) s3 is STD_LOGIC and size is not defined so by default it is 1 bit in size. Now s4 is a 8 bit sized vector whose MSB i.e. s4(0) is assigned to s3 that is also legal.

c) Here v1 is a 8 bit sized vector whose xor is done with a 8 bit sized vector and result is assigned to s2 that is also a 8 bit sized vector.

d) Here v2 is a integer type variable whose range is between -35 to 35. Now v2 is divided by 2 and result is saved in s5 which is also a variable of integer type ranging between -35 to 35. Now this is legal as whenever v2 is divided by 2, anyhow the result will be between -35 to 35 so it can be in the range of s5.

Add a comment
Know the answer?
Add Answer to:
Exercise 3.24: Legal Assignments #1 Confirm that the statements below are legal (see main causes of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT