0% found this document useful (0 votes)
9 views

Assignment 2 COA

Coa question bank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Assignment 2 COA

Coa question bank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

21CSS201T-COA

Assignment-2
1. List the major components of a computer system?
Ans: The major components of a computer system are:
1. Central Processing Unit (CPU): The "brain" of the computer, which performs
all calculations and processing tasks.
2. Memory (RAM): Temporarily stores data and instructions needed for
processing. It enables quick access to data for running programs.
3. Storage (Hard Drive or SSD): Stores data and files permanently, even when
the computer is turned off. It holds the operating system, applications, and
personal files.
4. Motherboard: The main circuit board that connects all components of the
computer, allowing them to communicate with each other.
5. Power Supply Unit (PSU): Converts electrical power from an outlet into
usable power for the computer’s components.
6. Input Devices: Devices like a keyboard, mouse, and scanner that allow the
user to input data and interact with the computer.
7. Output Devices: Devices like a monitor, printer, and speakers that display or
produce information for the user.
8. Graphics Processing Unit (GPU): Handles rendering images, videos, and
animations, especially in gaming, design, and video editing.
9. Cooling System: Includes fans, heatsinks, and sometimes liquid cooling to
keep the components at a safe operating temperature.
10.Network Interface Card (NIC): Allows the computer to connect to a network,
either wired or wireless, for internet access and network communication.
Each component plays a specific role in enabling the computer to perform various functions
efficiently.

2. Define addressing modes and its various types?


Ans: Addressing modes are the ways in which an instruction in a computer program
specifies the location of an operand, which is the data to be operated on. Each addressing
mode provides a way to identify the operand's memory location or how it should be
accessed by the CPU. Addressing modes help optimize code, make it easier to read, and
provide flexibility in accessing data.
Here are the main types of addressing modes:
1. Immediate Addressing Mode
 Definition: The operand is specified directly in the instruction.
 Example: MOV A, #5 — The value 5 is directly used as the operand.
2. Register Addressing Mode
 Definition: The operand is located in a CPU register rather than in memory.
 Example: MOV A, B — The data in register B is moved to register A.
3. Direct Addressing Mode
 Definition: The address of the operand is given explicitly within the
instruction.
 Example: MOV A, 1000 — The data at memory location 1000 is moved to
register A.
4. Indirect Addressing Mode
 Definition: The address of the operand is held in a register or memory
location, which points to the actual data.
 Example: MOV A, (R1) — The content at the address held in register R1 is
moved to register A.
5. Indexed Addressing Mode
 Definition: The effective address of the operand is generated by adding a
constant value to the content of a register.
 Example: Used often in array processing, where the base address of the array
is in a register, and an offset specifies the element.
6. Relative Addressing Mode
 Definition: The address of the operand is calculated relative to the current
program counter (PC).
 Example: Useful for branching instructions, where a jump is made relative to
the current instruction's address.
7. Base Register Addressing Mode
 Definition: The effective address is the sum of a base register value and an
offset.
 Example: Commonly used in high-level languages for array indexing.
8. Auto-Increment / Auto-Decrement Addressing Mode
 Definition: The register containing the address of the operand is incremented
or decremented automatically.
 Example: MOV A, (R1)+ — The content at address R1 is moved to A, then R1
is incremented.

3. Define ALU. What are the various operations performed in ALU?


Ans: An Arithmetic Logic Unit (ALU) is a fundamental component of a computer's central
processing unit (CPU) that performs arithmetic and logic operations on binary data inputs.
It’s often referred to as the "brain" of the CPU because it executes the core mathematical
and decision-making tasks required in computing.
Operations performed in an ALU:
1. Arithmetic Operations:
o Addition and Subtraction: Basic operations for adding and subtracting
binary numbers.
o Multiplication and Division: ALUs handle simple binary multiplication
and division or pass these tasks to more complex circuits if needed.
o Increment and Decrement: Increase or decrease a value by one,
commonly used for counters.
2. Logic Operations:
o AND: Returns true if both inputs are true.
o OR: Returns true if at least one input is true.
o NOT: Inverts the input (1 becomes 0 and vice versa).
o XOR (Exclusive OR): Returns true if one, but not both, of the inputs are
true.
o NAND and NOR: Variations on AND and OR that produce opposite
results.
3. Bitwise Operations:
o Shift Operations: Shift bits left or right, which can multiply or divide
binary numbers by powers of two.
o Rotate Operations: Rotate bits within a word, preserving the bit count.
4. Comparison Operations:
o Equal to (==): Checks if two values are the same.
o Less than (<) or Greater than (>): Compares two values to determine
order.
4. Give classification of memory?
Ans: Memory classification is commonly divided into several categories based on storage
duration, access method, and purpose. Here’s a general breakdown:
1. Classification by Duration
 Primary Memory (also known as Main Memory):
o RAM (Random Access Memory): Temporarily holds data and programs
currently in use; it is volatile, meaning data is lost when power is off.
o Cache Memory: A smaller, faster type of volatile memory used to store
frequently accessed data for quicker access.
 Secondary Memory:
o ROM (Read-Only Memory): Non-volatile memory that contains data
permanently written, such as firmware.
o Storage Devices: Non-volatile memory like hard drives, SSDs, and
optical drives for long-term data storage.
2. Classification by Purpose
 Volatile Memory: Requires power to maintain stored data (e.g., RAM).
 Non-volatile Memory: Retains data even when power is off (e.g., ROM, SSD,
Hard Drive).
3. Classification by Access Method
 Sequential Access Memory: Data is accessed in a fixed sequence (e.g.,
magnetic tapes).
 Random Access Memory: Data can be accessed in any order, making it faster
(e.g., RAM).
4. Other Types of Memory
 Virtual Memory: A section of a storage drive that acts as RAM when physical
RAM is insufficient.
 Flash Memory: Non-volatile memory used in USB drives, SSDs, and memory
cards, suitable for quick read/write cycles.
This classification helps organize memory based on its speed, volatility, and functionality,
supporting efficient data management in computing systems.

5. List the steps involved in the instruction execution?


Ans: The instruction execution process typically involves the following steps:
1. Fetch: The CPU retrieves the next instruction from memory, based on the
current value of the Program Counter (PC).
2. Decode: The instruction is decoded to determine what operation it
represents and which resources (registers, memory, or ALUs) are required for
its execution.
3. Fetch Operands: If the instruction requires operands, they are fetched from
the appropriate registers or memory locations.
4. Execute: The decoded instruction is processed by the CPU’s Arithmetic Logic
Unit (ALU) or other relevant execution units. For instance, it may perform an
arithmetic or logical operation.
5. Memory Access: If the instruction involves memory access (like
reading/writing data), the CPU accesses the memory to read or write data.
6. Write Back: The result of the instruction execution is written back to the
appropriate register or memory location.
7. Update Program Counter: The Program Counter (PC) is updated to point to
the next instruction, either sequentially or based on the instruction type
(e.g., for jumps or branches).
8. Repeat: The cycle repeats for the next instruction in the program.
This cycle, known as the Instruction Cycle or Fetch-Decode-Execute Cycle, continues until all
instructions are executed or a termination instruction is reached.

6. Explain the difference between the machine language and the assembly
language of the 8085 microprocessors?
Ans: The 8085 microprocessor has both machine language and assembly language for
programming, and each serves different purposes. Here’s a breakdown of the differences:
1. Machine Language
 Definition: Machine language is the lowest-level programming language,
consisting entirely of binary code (0s and 1s) that the microprocessor can
directly execute.
 Execution: Machine code is directly understood by the 8085 microprocessor
without needing any translation, making it faster to execute.
 Format: Each instruction is represented by a sequence of binary numbers,
which makes it difficult to read and write for humans.
 Use: Primarily used in applications where memory is very limited, and utmost
efficiency is required, as it’s more compact.
 Example: An instruction like "MOV A, B" in machine code might be
represented as 01000111 in binary.
2. Assembly Language
 Definition: Assembly language is a low-level programming language that uses
mnemonic codes or symbols instead of binary to represent each machine
language instruction.
 Execution: Assembly code must be translated (or assembled) into machine
language by an assembler before the microprocessor can execute it.
 Format: It is more readable for humans since it uses mnemonics like MOV,
ADD, and SUB to represent operations.
 Use: Often used in systems programming or embedded programming where
control over hardware is required without the complexity of binary coding.
 Example: The same instruction in assembly language would simply be written
as MOV A, B.
In summary, machine language is binary code directly executed by the 8085 microprocessor,
whereas assembly language uses mnemonics, making it more human-readable but
requiring translation to machine code for execution.

7. Define op code and operand, and specify the op code and the operand in
the instruction MOV H, L?
Ans: In computer programming, particularly in assembly language, an opcode (operation
code) and operand are fundamental parts of an instruction.
1. Opcode: This part of the instruction specifies the operation to be performed.
It tells the processor what action to execute, like addition, subtraction,
moving data, etc.
2. Operand: This part provides the data on which the operation is performed. It
could be a register, a memory location, or an immediate value (a direct value
in the code).
For the instruction MOV H, L:
 Opcode: MOV — This instructs the processor to move data.
 Operands: H and L — Here, H is the destination register, and L is the source
register. This means the contents of register L are moved to register H.

You might also like