0% found this document useful (0 votes)
168 views

Solution For HW#2: H/W Summary (20 Points) : ECE473/ECE573, Microprocessor System Design

This document summarizes the solutions to homework problems related to microprocessor system design. It addresses questions about the state of the P bit after instructions, bit addresses set by instructions, bit positions and byte addresses, the bit address of the most significant bit at a given RAM address, the active register bank after instructions, copying data from a register to external RAM, and bit-addressable registers in the 8051 microcontroller.

Uploaded by

Victor Loong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
168 views

Solution For HW#2: H/W Summary (20 Points) : ECE473/ECE573, Microprocessor System Design

This document summarizes the solutions to homework problems related to microprocessor system design. It addresses questions about the state of the P bit after instructions, bit addresses set by instructions, bit positions and byte addresses, the bit address of the most significant bit at a given RAM address, the active register bank after instructions, copying data from a register to external RAM, and bit-addressable registers in the 8051 microcontroller.

Uploaded by

Victor Loong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Solution for HW#2: H/W Summary (20 points)

ECE473/ECE573, Microprocessor System Design

1. What is the state of the P bit in the PSW after execution of each of the following
instructions? (3 points)
(a) CLR A
(b) MOV A, #03H
(c) MOV A, #0ABH

<Sol>
(a) A=0000 0000B  P=0
(b) A=0000 0011B  P=0
(c) A=1010 1011B  P=1

2. What bit addresses are set to 1 as a result of the following instructions? (5 points)

<Sol>
(a) MOV 26H, #26H
The data of 0010 0110B is copied to the byte address of 26 in the RAM. The bit
addresses in this address are (37,36,35,34,33,32,31,30).
 Therefore, the bit addresses are set to 1 are 35, 32, and 31.

(b) MOV R0, #26H


MOV @R0, #7AH
The data of 0010 0110B is copied to R0 in the RAM. The data of 0111 1010B is
copied to the place corresponding to the byte address of 26H. So the bit addresses
in this address are (37,36,35,34,33,32,31,30).
 The bit addresses are set to 1 are 36, 35, 34, 33, and 31.

(d) MOV A, #13H


The data of 0001 0011B is copied to ACC in the RAM. The byte address for ACC
is E0. The bit addresses for this address are (E7,E6,E5,E4,E3,E2,E1,E0)
 Therefore, the bit addresses are set to 1 are E4, E1, and E0.

(d) MOV 30H, #55H


XRL 30H, #0AAH
The data of 0101 0101B is copied to the byte address of 30H in the RAM. The
data of 1010 1010B XOR with the data of 0101 0101B and results in the data of
1111 1111B, which is stored in the address of 30H.
However, byte address of 30H is not the bit-addressable.

(e) SETB P1.1


The bit address for P1.1 is 91.
(f) MOV P3, #0CH
The data of 0000 1100B is copied to byte address of P3. The bit addresses for P3
are (B7,B6,B5,B4,B3,B2,B1,B0).
 The bit addresses are set to 1 are B3, and B2.

3. Identify the bit position and byte address for each of the following instructions. (3
points)
<Sol>
(a) SETB 0A8H
Bit address of A8 is located in IE register. The byte address for IE is A8H.

(b) SETB 84H


Bit address of 84 is located in P0. The byte address for P0 is 80H.

(c) SETB 63H


Bit address of 63 is located in byte address of 2CH.

4. What is the bit address of the most-significant bit (bit 7) at byte address 25H in the
8051s internal data memory (RAM)? (2 points)
<Sol>
The bit address is 2FH.

5. What is the active register bank after execution of each of the following instructions?
(3 points)
<Sol>
(a) MOV PSW, #0C8H
1100 1000B is loaded to PSW register.  RS1=0, and RS0=1 Register Bank 1

(b) MOV PSW, #50H


0101 0000B is loaded to PSW register.  RS1=1, and RS0=0 Register Bank 2

(c) MOV PSW, #10H


0001 0000B is loaded to PSW register.  RS1=1, and RS0=0 Register Bank 2

6. What instruction sequence could be used to copy the content of R7 to external RAM
location 100H? (2 points)
<Sol>
MOV DPTR, #100H
MOV @DPTR, R7

7. What registers in SFR (RAM) are bit-addressable registers and what are their byte
addresses? (2 points)
<Sol>
There are 11 bit addressable registers such as B, ACC, PSW, IP, P3, IE, P2, SCON,
P1, TCON, and P0. The addresses for them are F0, E0, D0, B8, B0, A8, A0, 98, 90,
88, and 80 respectively.

You might also like