University of Sharjah College of Engineering Department of Computer Engineering 0403332 Microprocessors & Interfacing Fall 2001 Semester Examination 1
Student ID Question 1 Question 2 Question 3 Total
20 40 40 100
• Time allowed: 50 minutes • This is a OPEN BOOK, CLOSED NOTES examination. • Attempt ALL questions. • The exam paper consists of 6 pages. • Candidates are NOT permitted to use calculators in this examination. • If you have questions, ask only the instructor of your course. • Answer in the space provided. • DO NOT write your name anywhere on the exam sheet.
Question 1. (20 points) Answer True or False for each of the following statements (2 points each) 1.
all the instructions that the microprocessor can understand.
T
F
2.
Only one device can be connected to a unidirectional bus.
T
F
3.
Assembly Language is a symbolic representation of Machine Language.
T
F
4.
Memory stores information in Hexadecimal format.
T
F
5.
All registers in the 8085 are 8-bits
T
F
6.
Data Transfer operations do not update the flags register.
T
F
7.
A 2 MegaByte memory chip has 21 data pins.
T
F
8.
The instruation LDAX D loads the DE register pair with the contents of the memory location pointed to by the HL register pair.
T
F
9.
It is possible to have F130H as the first address of a 1K memory chip.
T
F
Yes
Yes
10. This class is fun
2
Question 2. (30 points) An existing memory system has the memory map shown in Figure 1. Using only the following chips, design the circuit needed to fill in the holes. Chip Type 8 K Byte RAM chip 74138 Decoder 2-input AND gate Inverter
Count 2 1 4 4
0000H 16 K EPROM
8K RAM1 8K RAM2
9FFFH
16 K RAM 3 FFFFH
Figure 1 2.1.
Determine the starting and ending addresses for each of the new memory chips. (15 Points)
3
2.2.
Determine the combinations needed for the chip select of the new memory chips. (6 Points)
2.3.
Draw the circuit.
(9 Points)
(Only show the 74138 and its connections. No need to draw the memory chips.)
4
Question 3. Determine the memory map for the memory system shown in Figure 2. A15
G A 13
(10 points)
A14
1
G2A G2B
MSB O6
A12
O2
74138 A11
CE
A11
CE
4K RAM 2
4K RAM 1 A0
A0
Figure 2.
5
Question 4 (40 Points) 4.1 Given the memory contents shown below, execute the following program and show the contents of the registers and the state of the flags after each instruction. (20 Points)
4000 4001 4002 4003
ORG LDA LXI INR MOV XRA DCX DCX MVI ADD CMA
4.2
2000H 4000H H 3F01H H B M B H H C 21H C
A
B
C
H
L
Z
3F B3 16 24
S
CY
Memory locations 4000H and 4001H have some data. Write a program to read the data from location 4000H, switch the upper and lower nibbles (for example, 3A becomes A3), then compare the result with the contents of location 4001H. If they are equal, store the result of the switching in location 4002H. Otherwise, store 00H in 4002H. (20 Points)
6