Q1. Chose the correct answer [15 mark]
1) The small extremely fast, memory all called as ________
A. Cache B. Heaps C. Accumulator D. Stack
2) The processor's internal components are connected by ________
A. Processor intra- connectivity B. Processor Bus C. Memory bus D. RAMbus
3) Data is stored in registers via ________
A. D flip flop B. JK flip flop C. RS flip flop D. None of above
4) When we perform subtraction on -7 and -5 the answer in 2’s complement form is
A. 11110 B. 1110 C. 1010 D. 0010
5) If a system is 64 bit machine, then the length of each word will be
A. 4 bytes B. 8 bytes C. 16 bytes D. 12 bytes
6) The requested data resides in a given level of memory is _________
A. Hit B. Miss C. average memory access D. None of above
7) Which of the following memories must be refreshed many times per second?
A. EPROM B. ROM C. Static RAM D. Dynamic RAM
8) How many memory locations can be addressed by a CPU with 14 address lines?
A. 2K B. 4K C. 8K D. 16K
9) In relative address mode the effective address is --------
A. AC + Relative address
B. PC + Relative address
C. IR + Relative address
D. BR + Relative address
10) ----------operation performs bit manipulation on numeric data.
A. Register Transfer B. Arithmetic C. Logical D. Shift
11) How many possible outputs would a decoder have with a 6-bit binary input?
A. 16 B. 32 C. 64 D. 128
12) A combinational circuit that selects one from many inputs are----------
A. Encoder B. Decoder C. Demultiplexer D. Multiplexer
13) There are ----------- categories of the most common microoperations.
A. two B. three C. Four D. Five
14) The __________ moves data between the computer and its external environment.
A. data transport B. I/O C. CPU interconnection D. register
15) How many address and data lines will be there for a 16M x 32 memory system?
A. 24 and 5 B. 20 and 32 C. 24 and 32 D. None of the above
Q2) state whether TRUE or FALSE [10 mark]
1. Register is implemented inside the main memory on computer board. False
2. Static RAM is typically used to implement Cache . True
3. The main memory of a computer system provides random access. True
4. The main objective for using cache memory is to increase the effective speed of the
memory system. True
5. Control bus is a group of lines used for the purpose of data flow. True
6. 1011-1001-1001 = -0011. False
7. PROM can be erasable . False
8. The memory is the brain of the computer. False
9. A bus is a collection of wires that carry information as electrical signals between the
hardware components of a computer. True
10. A kilobyte of storage is 210 = 1,024 bytes, where a byte is a collection of eight bits. True
Certainly! Let’s compute the subtraction of A and B using 2’s complement representation.
Convert Decimal Numbers to Binary (2’s Complement):
- A = 54:
- The binary representation of 54 is 00110110.
- B = -77:
- To find the 2’s complement of -77, follow these steps:
- Represent 77 in binary: 01001101.
- Invert all the bits: 10110010.
- Add 1 to the inverted value: 10110011.
- To find the 2’s complement of -77, follow these steps:
- A = 54:
Perform Subtraction:
- We’ll subtract B from A:
00110110 (A)
10110011 (2’s complement of B)
01100001- The result in binary is 01100001.
- We’ll subtract B from A:
Convert Binary Result to Decimal:
- The binary result 01100001 represents a positive number.
- Converting it to decimal: 2^6 + 2^5 + 2^0 = 64 + 32 + 1 = 97.
Check for Overflow:
- In 4-bit 2’s complement representation, we can represent numbers from -8 to 7.
- The result (97) lies outside this range.
- Therefore, there is an overflow.
In summary:
- The result of A - B is 97 in decimal.
- Since 97 is outside the representable range, there is an overflow12.
1-Bit Adder with AND, OR, and NOT Gates
Here's the combinational logic block for a 1-bit adder using AND, OR, and NOT gates:
Inputs:
- A: One binary input bit
- B: Another binary input bit
Output:
- Sum: The sum bit of the addition (XOR of A and B)
Circuit Diagram:
A
/ \
/ \
/ \
/ \
NOT(A) B
\ /
\ /
\ /
\ /
|
XOR
|
/ \
/ \
/ \
Sum Carry
Explanation:
-
XOR Gate: The XOR gate takes A and B as inputs. Its output represents the Sum of the 1-bit addition. XOR produces a 1 when the inputs are different (0 and 1 or 1 and 0), resulting in a sum of 1 without a carry. When both inputs are the same (0 and 0 or 1 and 1), the XOR outputs a 0, indicating a sum of 0, but potentially with a carry (explained next).
-
Implicit Carry: In this design, a separate carry output is not explicitly shown. However, you can understand the carry situation by analyzing the combination of inputs:
- If A and B are both 1, the XOR will output 0 (sum = 0), but there's a carry-out since two 1s are being added. This carry would need to be propagated to the next higher bit position in a multi-bit adder.
Alternative Implementation (Explicit Carry):
Here's a variation of the circuit with an explicit Carry output using an additional AND gate:
A
/ \
/ \
/ \
/ \
NOT(A) B
\ /
\ /
\ /
\ /
|
AND
| (A AND B)
/ \
/ \
/ \
Sum Carry
- In this version, an AND gate takes A and B as inputs. It outputs a 1 only when both A and B are 1, indicating a carry situation (Carry = A AND B).
- The Sum output remains the same (XOR of A and B).
Both implementations achieve the same functionality for a 1-bit adder. The choice depends on your specific needs and how you want to handle the carry signal in a larger multi-bit adder.
Practical Exam:
section .data Var1 db 1 ; Variable Var1 initialized with value 1 Var2 db 2 ; Variable Var2 initialized with value 2 section .text global _start _start: ; Load Var1 into AL and Var2 into BL mov al, [Var1] mov bl, [Var2] ; Initialize AX register to 0 (to store the result) xor ax, ax ; Loop counter initialization mov cx, 100 loop_start: ; Multiply AL and BL and store the result in AX mul bl ; Check if loop counter (CX) is equal to 1 cmp cx, 1 je loop_end ; If CX = 1, jump to loop_end (to exit the loop) ; Decrement loop counter dec cx ; Jump to loop_start to continue the loop jmp loop_start loop_end: ; Program ends here ; Exit the program mov eax, 1 ; syscall number for exit xor ebx, ebx ; exit status 0 int 0x80 ; invoke syscall