Mictrocontroller Week 03
bits for the representation):
a) 121 – 185
b) -70 – 88
==
4. Convert back to verify answer
==
5. Calculate the following without converting the number base. Show calculations.
a) 3A916 + 24D16
==
5. 5F616
==
6. Variable X contains the number of bytes to be read from an external device. Using a binary
shift, write one line of pseudocode to calculate the number of bits to be read and store the
result in Y.
==
6. Y = X shl 3 // shifts left by 3 bits, filling the emply bits on the right with zeros (3 bits)
==
7. You have two Boolean variables A and B. Write down a logic expression using only the
operators AND, OR and NOT that will evaluate to true if A and B are equal and to false
otherwise.
==
7. (A and B) or ((not A) and (not B))
==
8. You have two strings stored in variables S1 and S2. Both strings are stored in ASCII format
and contain 8 bits per character and 20 characters per string. Write pseudocode that will