EE 2361 - Introduction to Microcontrollers
Summer Term, 2005
Homework Assignment 1
Due: Friday, June 24
- Convert each of the following decimal numbers
into an 8-bit unsigned binary number:
- 253
- 17
- 128
- Convert each of the following unsigned hex numbers into decimal:
- $ABCD
- $7008
- $2F
-
Three 8-bit signed numbers are given below,
expressed in hex format. Compute the two's complement of each
number and express your answers in hex format.
Also, give the decimal equivalents of each
original number and its two's complement.
- $AC
- $07
- $FE
-
Sign-extend each of the following 8-bit signed numbers
expressed in hex format to a 16-bit signed number expressed
in hex format:
- $92
- $7F
-
Perform the indicated 16-bit arithmetic operations assuming all of
the numbers are signed. Express your answers
as 16-bit signed numbers
in hex format. In each case, indicate
whether or not a signed overflow occurs.
- $80CD + $1701
- $80CD + $8701
- $80CD - $8701
- $8701 - $70CD
- Give the addressing mode and the effective address for each of
the following instructions. Assume that index register X contains
$1234 and index register Y contains $A321.
- stab 4, x
- ldab 9, y
- ldaa $F0AB
- staa $DE
- ldab #$88
- For each of the instructions given in question 6 above,
draw a diagram that shows the byte in memory at the effective address,
the relevant accumulator (i.e, A or B), and an arrow indicating the transfer
of information from one place to the other.
- Suppose that register D contains $3456, index register X
contains $1234 and index register Y contains $A321. Also,
assume that a portion of memory is configured as follows:
| Address | Data |
| $9000 | $AC |
| $9001 | $BD |
| $9002 | $00 |
| $9003 | $FF |
| $9004 | $DE |
| $9005 | $34 |
Suppose that the following sequence of instructions
are executed. Give the contents of registers
D, X, and Y, and the contents of memory locations
$9000 - $9005 after the last instruction has been executed.
ldd $9004
stx $9004
sty $9000
ldy $9002
ldx #$FEDC