(Computer Assembly Language)
54. In a pure load store architecture, no instructions other than the load and store instructions are allowed to directly access memory. page: 275
Short Answer
55. Given the instruction set for MARIE
Write the assembly language equivalent for the machine instruction: 0011 000000000101 Page: 236
56. Given the instruction set for MARIE
Write the assembly language equivalent for the machine instruction: 1011 000000001111 Page: 236
57 Given the instruction set for MARIE
Wite the assembly language equivalent for the machine instruction: 1000 100000000 Page: 236
The instruction set for MARIE is given.
In MARIE, each instruction is of 16 bits in which first 4 bits represent the opcode and last 12 bits are used for representing the address.
For example-
In instruction 1000010101010110
1000 represents opcode
01010101010110 represents address
From the table given if we convert instruction opcode from hexadecimal to binary-
Instruction opcode | Instruction |
0000 | JnS X |
0001 | Load X |
0010 | Store X |
0011 | Add X |
0100 | Subt X |
0101 | Input |
0110 | Output |
0111 | Halt |
1000 | Skipcond |
1001 | Jump X |
1010 | Clear |
1011 | AddI X |
1100 | JumpI X |
Now coming on to the questions:
Q.55 Write the assembly language equivalent for the machine instruction:
0011 000000000101
0011 represents opcode
000000000101 represents address
From our table opcode 0011 represents the instruction Add X
that means Add the value present at address 000000000101 to the value present in the accumulator and store the result in the accumulator.
Q.56 Write the assembly language equivalent for the machine instruction:
1011 000000001111
1011 represents opcode
000000001111 represents address
From our table opcode 1011 represents AddI X
that means Add indirect that means use value present at address 000000001111 as the actual address of the operand and fetch operand by going to that address and then add the value of operand to the value present in the accumulator and store the result in the accumulator.
Q.57 Write the assembly language equivalent for the machine instruction:
1000 100000000000
1000 represents opcode
100000000000 represents address
From our table 1000 represents Skipcond
Now we will try to understand what this Skipcond is doing-
Skipcond is skipping next instruction if AC is negative, positive or zero
Now number bits from 1 to 16 starting from the last in the instruction.
Tenth and eleventh bit of instruction are used to determine the skipping condition.
if Bits 11 and 10 are 00 then this translates to skip the next instruction if AC is negative.
if Bits 11 and 10 are 01 then this translates to skip the next instruction if AC is zero.
if Bits 11 and 10 are 10 then this translates to skip the next instruction if AC is positive.
In our case they are 10 then our assembly language equivalent is:
Skip the next instruction if AC is positive.
54. In a pure load store architecture, no instructions other than the load and store instructions are allowed to directly access memory. page: 275
2. Suppose that a 16M X 16 main memory is built using 512K X 8 RAM chips and memory is word addressable. a) How many RAM chips are necessary? ______ b) How many RAM chips are needed for each memory word? _______ c) How many address bits are needed for each RAM chip? _______ d) How many address bits are needed for all memory? _______ A digital computer has a memory unit with 24 bits per word. The instruction set...
Given the instruction set for MARIE: Write the assembly language equivalent for the machine instruction: 1011 000000001111. Instruction Instruction Instruction Opcode JnS X Instruction Halt Skipcond (00 for ACO, 01 for AC-0, 10 for AC0) Jump X Clear AddI X Jumpl X Opcodde Load X8 Store X9 Add X Subt X B Input Output Instruction Instruction Instruction Opcode JnS X Instruction Halt Skipcond (00 for ACO, 01 for AC-0, 10 for AC0) Jump X Clear AddI X Jumpl X Opcodde...
Answer all elaborately or dont even attempt. 7. (4 points) Explain why, in MARIE, the MAR is only 12 bits wide while the AC is 16 bits wide. Hint: Consider the difference between data and addresses. 8. (24 points) Use a few sentences to answer each of the following questions. The answers can be found in section 4.1 to 4.7 in the textbook. 1) What purpose does the datapath in a CPU serve? 2) What does the control unit in...
26. The is a group of bits that tells the computer to perform a specific operation A). program counter B). Opcode C). register D). microoperation 27. A condition called occurs in unsigned binary representation of a number when the result of an arithmetic operation is outside the range of allowable precision for the given number of bits. A). underflow B). 2's complement C). overflow D) bitwise complement 28. An iteration of the fetch-decode-execute cycle includes which of the following events?...
Questions1. The function L is defined as L(1) = 2,L(2) = 1,L(3) = 3,L(4) = 4 and for n ≥ 4,L(n + 1) = L(n) + L(n − 1) + L(n − 2)L(n − 3)i.e., the (n + 1)-th value is given by the sum of the n-th, n − 1-th and n − 2-th values divided by the n − 3-th value.(a) Write an assembly program for computing the k-th value L(k), where k is an integer bigger than...
Group Project 1 The Micro-1 Processor Simulation <Micro-1 Computer> Here's the organization of a computer equipped with a Micro-1 processor Memory contains an array of integer cells: int cell[] = new int[CAP]; where CAP is the capacity of memory. Initially this is set to 256. Internally, the Micro-1 processor is equipped with eight 32-bit data/address registers and two 32 bit control registers: PC, the program counter, contains the address of the next instruction to execute. IR, the instruction register, contains...