My ALU can perform 63 operations and there are 5 registers in my datapath. Write
the respective machine code which should be generated by Controller for the
following Micro-Instructions:
MDR1
BUSIN
(Use the order of registers as follows: IR, MAR, MDR1, MDR2, PC MUXI, MUXU, MUX2
(ALU))
Let us assume that code of ALU for memory instruction is 000000 and O for Muxi to pick
data from MDR2 and 1 for MUX1 to pick data from PC. Lets o for
me to pak data from
DataBus and 1 from ALU.
Answers
Answer:
sorry but I don't know what is this subject
Explanation:
sorry but I don't know what is this subject
Answer:
The programming respective machine code should be generated by the Controller for the following Micro-Instructions
Explanation:
Multiplication of two 8 bits numbers using 8085 microprocessor with carry.
Algorithm:
- Load HL pair with initial data using LHLD command.
- Exchange the data of HL and DE pair using XCHG command.
- Copy the data of register D into Register C.
- Now initialize register D with 0.
- Also initialize HL pair with 0 using LXI command.
- Use the DAD command to add the data of DE pair into the data of HL pair and store in HL Pair.
- Decrease the value of C by one.
- Check if the result from previous instruction resets the zero flag and if true, jump to address XXX.
- Store the content of the HL pair into desired location.
- Stop.
Program:
LHLD 2050
XCHG
MOV C, D
MVI D 00
LXI H 0000
xxx DAD D
DCR C
JNZ 200A
SHLD 3050
HLT
Observation:
INPUT:
2050:43
2051:07
OUTPUT:
3050:D5
3051:01
Algorithm
1. Start the program by loading HL register pair with address of memory location.
2. Move the data to a B register.
3. Get the second data and load into Accumulator.
4. Add the two register contents.
5. Check for carry.
6. Increment the value of carry.
7. Check whether repeated addition is over and store the value of product and carry in memory location.
8. Terminate the program.
Program and Result
MVI D, 00 ;Initialize register D to 00
MVI A, 00 ;Accumulator content to 00
LXI H, 5000
MOV B, M ;Get the first number in B - reg
INX H ;Increment HL pair of register
LOOP: ADD B ;Add content of A - reg to register B
MOV C, M ;Get the second number in C- reg
JNC ;NEXT Jump on no carry to NEXT.
INR D ;Increment content of register D
NEXT: DCR C ;Decrement content of register C
JNZ LOOP ;Jump on no zero to address
STA 5002 ;Store the LSB of result in Memory
MOV A, D ;Move content of D-Reg to A-Reg
STA 5003 ;Store the MSB of result in Memory
HLT ;Terminate the program.
Result:
Input:
Data 1: 80H in memory location 5000
Data 2: 76H in memory location 5001
Output:
Data 1: 00H in memory location 5002
Data 2: 0AH in memory location 5003