Solution Manual for Introduction to Mechatronic Design Do Not Circulate
Chapter 3 Microcontroller Math and Number Manipulation
3.1) Convert the following binary patterns to hexadecimal:
1101
01010
10011
11001100
110011000001
3.2) Construct a comparison expression that will test if bits 0, 2 & 4 in a byte are all in the high state without
altering the state of the byte.
3.3) Construct an expression that will clear bits 1, 3 & 5 in a byte-sized variable called Bumpers while not
altering any of other bits.
3.4) Construct an expression that will set bit 1 in a byte-sized variable called PortA without affecting any of the
other bits in the variable.
3.5) Write out the 16 bit hexadecimal representation of the following signed decimal numbers (assume the
representation is 2’s complement):
10
17
27
-45
-128
127
10 = 0x000A
17 = 0x0011