Lab 2 - FL13 - ECE 198 JL - University of Illinois - Engineering Wiki

Lab 2 FL13 ECE 198 JL University of Illinois Engineering Wiki

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: p; x 0080 x 45ff & ~ 1 x 1234 ^ x 5678 x 1234 & ~ x 5678 | ~ x 1234 & x 5678 Ans wer the following ques tions : 1. 2. 3. 4. 5. 6. W hat are c omputations 1-3 doing? (what does a func tion that c omputes f(x ) = x & 1 do?) W hat are c omputations 4-6 doing? (hint: s uppos e eac h of the 16 bits bit repres ents a light s witc h that is either on or off) Continuing with the a light s witc h (or s imilar) analogy , what is c omputation 7 doing? W hy does c omputation 8 produc e a nonz ero res ult, but c omputation 9 produc es z ero? W hat is c omputation 10 doing? (what does a func tion that c omputes f(x ) = x & ~ 1 do?) Compare the res ults of c omputation 11 and 12. Can y ou ex plain? Bit shifting In this c alc ulator's language, “< < ” means s hift left and “> > ” means s hift right. For ex ample, a < < b s hifts the bits in a left b plac es . In s igned 16-bit mode, run the following c omputations : 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 4 << 0 4...
View Full Document

This document was uploaded on 03/22/2014.

Ask a homework question - tutors are online