COA Course Pack Answers
COA Course Pack Answers
COA Course Pack Answers
Q2.
Q3.
Q4.
Q5.
Q6.
Same as 17 question
Q7.
Q8.
For three, the one thing you need to pay attention to is arithmatic shifts to the right. Shift the numbers to
the right as you normally would, but in order to preserve the sign of the number, the most significant bit
(the bit farthest to the left) gets copied to the corresponding bit of the new number.
Q9.
Q10 Represent 25 H, 42 H and 2000 H into binary numbers.
1.
25H:
• 2 in hexadecimal is 0010 in binary.
• 5 in hexadecimal is 0101 in binary.
Therefore, 25H in binary is 0010 0101.
2. 42H:
• 4 in hexadecimal is 0100 in binary.
• 2 in hexadecimal is 0010 in binary.
Therefore, 42H in binary is 0100 0010.
3. 2000H:
• 2 in hexadecimal is 0010 in binary.
• 0 in hexadecimal is 0000 in binary.
• 0 in hexadecimal is 0000 in binary.
• 0 in hexadecimal is 0000 in binary.
Therefore, 2000H in binary is 0010 0000 0000 0000.
The two instructions you provided have different meanings in assembly language:
In summary, the first instruction (MOV BL, 25H) directly loads the constant value 25H into the register BL, while the
second instruction ( MOV BL, [25H]) loads the byte from the memory address specified by 25H into the register BL. The
square brackets [ ] in the second instruction indicate a memory access operation.
Q12. In following assembly language program, identify that which type of addressing mode has been used in
each ofthe instructions.
In the provided assembly language program, let's identify the addressing modes used in
each instruction:
(a) 2K x 16;
(b) 64K x 8;
(c) 16M x 32;
(d) 4G X 64.
Q14.How many 128 x 8 memory chips are needed to provide a memory
capacity of 4096 x 16?
Q15.
Show the value of all bits of a 12-bit register that hold the number
equivalent to decimal 215 in (a) binary; (b) binary-coded octal; (c) binary-
coded hexadecimal; (d) binary-coded decimal (BCD).
Q16.
Perform the arithmetic operations (+42) + (- 13) and (-42) - (- 13) in binary
using signed-2's complement representation for negative numbers.
a) (+42) +(-13)\
Q17.
Q18.
The 8-bit registers AR, BR, CR and DR initially have the following values:
AR AR + BR
CR CR ^
DR, BR
BR +1 AR AR – CR
Q19.
A computer uses a memory unit with 256K words of 32 bits each. A binary
instruction code is stored in one word in memory. The instruction has four
parts: an indirect bit, an operation code, a register code part to specify one of
64 registers, and an address part.
A. How many bits are there in the operation code, the register code part, and
the address part?
B. Draw the instruction word format and indicate the number of bits in each
part.
C. How many bits are there in the data and address inputs of the memory?
Q21.A digital computer has a memory unit with a capacity of 16,384
words, 40 bits per word. The instruction code format consists of six
bits for the operation part and 14 bits for the address part (no indirect
mode bit). Two instructions are packed in one memory word and a
40-bit instruction register IR is available in the control unit. Formulate
a procedure for fetching and executing instructions for this computer.
Ans
013 HLT
016 C1A5
017 93C6
Q23. Write a program to evaluate the arithmetic statement:
X = (A + B) * (C + D)
Q25. The memory unit of a computer has 256K words of 32 bits each. The
computer has an instruction format with four fields: an operation code field,
a mode field to specify one of seven addressing modes, a register address
field to specify one of 60 processor registers, and a memory address. Specify
the instruction format and the number of bits in each field if the in
instruction is in one memory word.
Q26
.An instruction is stored at location 300 with its address field at
location 301. The address field has the value 400. A processor
register R 1 contains the number 200. Evaluate the effective address
if the addressing mode of the instruction is (a) direct; (b)
immediate; (c) relative; (d) register indirect; (e) index with R1 as the
index register.
Q28. The two-word instruction at address 200 and 201 is a "load
to AC" instruction with an address field equal to 500. The first word
of the instruction specifies the operation code and mode, and the
second word specifies the address part. PC has the value 200 for
fetching this instruction. The content of processor register R 1 is 400,
and the content of an index register XR is 100. AC receives the
operand after the instruction is executed. The figure lists a few
pertinent addresses and shows the memory content at each of these
addresses. Calculate the effective address and the operand that must
be loaded into AC for (a) Direct, (b) Immediate, (c) Indirect, (d)
Relative, (e) Indexed (f) Register (g) Register Indirect (h)
Autoincrement, (i) Autodecrement addressing mode.
Q34. Perform the arithmetic operations below with binary numbers and
with negative number in signed-2"s complement representation. Use seven
bits to accommodate each number together with its sign. In each case,
determine if there is an overflow by checking the carries into and out of the
sign bit position.