Computer Organization and Architecture
Computer Organization and Architecture
Architecture
Decimal (base-10): Uses ten digits (0–9) with place values powers
of 10 (Number System and Base Conversions | GeeksforGeeks). It is
our standard arithmetic system (e.g., 653₁₀ = 6·10² + 5·10¹ + 3·10⁰
(Binary to Decimal Converter)).
Binary (base-2): Uses two digits (0,1). Each bit’s place value is a
power of 2 (Number System and Base Conversions |
GeeksforGeeks). For example, 1101₂ = 1·2³ + 1·2² + 0·2¹ + 1·2⁰ =
13₁₀ (Binary to Decimal Converter). Binary is the core language of
computers.
Hexadecimal (base-16): Uses digits 0–9 and letters A–F for 10–15
(Number System and Base Conversions | GeeksforGeeks). Each hex
digit represents four binary bits, so 10011100₂ = 9C₁₆. Hex is
compact for large binary numbers.
Basic logic gates – AND & OR: An AND gate outputs 1 only if all
inputs are 1 (What are logic gates? | Definition from TechTarget). An
OR gate outputs 1 if any input is 1 (What are logic gates? | Definition
from TechTarget). If both inputs are 0, AND gives 0 and OR gives 0;
these definitions align with the logical operations.
Basic logic gates – NAND & NOR: A NAND gate is simply an AND
gate followed by a NOT; it outputs 0 only when all inputs are 1,
otherwise 1 (What are logic gates? | Definition from TechTarget). A
NOR gate is an OR gate followed by NOT; it outputs 1 only when all
inputs are 0, otherwise 0 (What are logic gates? | Definition from
TechTarget). Because NAND and NOR can realize any Boolean
function, they are called universal gates (What are logic gates? |
Definition from TechTarget).
Important Questions
5. For inputs A=1 and B=0, what are the outputs of the AND,
OR, XOR, and XNOR gates?
Answer: Plug in A=1, B=0:
o AND outputs 0 (since both inputs are not 1) (What are logic
gates? | Definition from TechTarget).
o XNOR outputs 0 (inputs are not the same) (What are logic
gates? | Definition from TechTarget).
NOT gate: A NOT gate (inverter) has one input; it outputs the
logical opposite. If input is 1, output 0; if input 0, output 1 (What are
logic gates? | Definition from TechTarget). It is the simplest gate
(Figure: input →●→ output bubble).
NOR gate: A NOR gate outputs 1 only if all inputs are 0, otherwise
0 (What are logic gates? | Definition from TechTarget). It is an OR
gate followed by NOT. Example: (0,0→1; all others→0). Like NAND,
NOR is universal for building any logic.
single bits (A and B). It has two outputs: Sum = A ⊕ B and Carry =
Half-adder: A half-adder is a combinational circuit that adds two
Important Questions
1. Give the truth tables for the XOR and XNOR gates.
Answer: By definition, XOR outputs 1 only when inputs differ (What
are logic gates? | Definition from TechTarget), and XNOR outputs 1
only when inputs are the same (What are logic gates? | Definition
from TechTarget). Their truth tables for inputs (A,B) are:
4. Y3 Y2 Y1 Y0 | A1 A0
5. 0 0 0 1 | 0 0
6. 0 0 1 0 | 0 1
7. 0 1 0 0 | 1 0
8. 1 0 0 0 | 1 1
For example, if input Y2=1 (others 0), the output is 10₂ (decimal 2). Each
output code uniquely identifies which single input is active (Encoder in
Digital Logic | GeeksforGeeks).
10. For inputs A=1 and B=0, what are the outputs of the
AND, OR, XOR, and XNOR gates?
Answer: Substituting A=1, B=0:
o AND: 1·0 = 0 (What are logic gates? | Definition from
TechTarget).
Important Questions
2. What are the roles of the Program Counter (PC) and the
Instruction Register (IR)?
Answer: The PC holds the memory address of the next instruction
to execute (Different Classes of CPU Registers | GeeksforGeeks).
After an instruction is fetched, the PC is incremented (or changed by
a branch). The IR holds the current instruction fetched from memory
(Different Classes of CPU Registers | GeeksforGeeks). The control
unit decodes the bits in the IR to know which operation to perform
and which operands to use. In summary, PC sequences through
addresses, and IR carries the current instruction for execution.
Important Questions
Important Questions