Module 1-3 Flashcards
Difference between Computer Organisation and Architecture
Computer Architecture:
* Focuses on how hardware parts are linked to work together inside a computer
* Bridge between hardware and software
* Programmers see it through instructions, addressing modes and registers
* Its a higher level of design
* Comes first while planning out a system
Computer Organisation
* Looks into how the system is built physically
* It deals with how the parts are arranged and organised
* Lower level of design, deals with adders subtractors, registers etc
* Its the practical realization of the architecture
* Organisation follows architecture
What is a Bus?
A communication pathway connecting two or more devices
For Ex: A bus enables a computer processor to communicate with the memory or video card to communicate with the memory
- There are a number of possible interconnection
systems - Single and Multiple bus structures
- Control/Address/Data Buses.
Have following major functions:
* Data Sharing: Serial/Parallel buses, 8, 16, even 32 bits.
* Addressing: Has address lines to send data to from memory locations
* Power: Can be used to supply power to various peripherals
* Timing: System clock synchronise the peripherals attached to it with the rest of the system.
Explain the Von Neumann Concept
The Von Neumann architecture is based on the stored-program concept, which means that program instructions and data are stored in the same memory.
Main Memory
Stores programs and data in binary form.
Accessible to both the Central Processing Unit (CPU) and Input/Output devices.
Data and instructions are retrieved from memory as needed for processing.
Arithmetic Logic Unit (ALU)
Performs all arithmetic and logical operations (e.g., addition, subtraction, AND, OR).
Operates on binary data provided by memory or other parts of the CPU.
Control Unit
Directs the operation of the processor.
Fetches instructions from memory, decodes them, and executes them by coordinating with the ALU and other components.
Input and Output Equipment
Input devices (e.g., keyboard, mouse) feed data into the system.
Output devices (e.g., monitor, printer) present processed data to the user.
The control unit manages data transfer between the CPU and these devices.
Types of Buses
Dedicated
* Separate data and address lines
Multiplexed
* Shared lines
* Address valid or data valid control lines
* Advantage: Fewer lines
* Disadvantage: Complex controls, ultimate performance
Bus Arbitration
Types:
Central: Only a single bus arbiter or controller, this arbiter determines which device gets access to the bus at what times.
Distributed:The devices themselves coordinate and have embedded logic to determine who gets to control the bus at any given moment.
PCI bus
Peipheral Component Interconnect
Direct Memory Access (DMA): PCI allows devices to access the system memory directly, which speeds up data transfer.
Plug and Play (PnP): Intel added PnP functionality to PCI, making it easier for the system to recognize and configure new devices automatically.
PCI Bus Lines (Required)
System Lines:
Include essential control signals like clock and reset to synchronize all connected devices.
Address & Data:
32 Multiplexed Lines: These lines are shared for both address and data transmission, reducing the number of physical lines required.
Interrupt & Validate Lines: Ensure proper data validation during operations.
Interface Control:
Manages the interaction between devices, ensuring commands are issued and executed in an orderly fashion.
Arbitration:
Arbitration is not shared, meaning each device has direct communication with the bus arbiter to prioritize and manage data flow.
Error Lines:
Provide mechanisms for error detection and correction, ensuring reliable communication between components.
SCSI Bus
Small Computer System Interface
It’s a fast bus designed to have multiple devices connect to a system simultaneously. Devices like hard disks, printers, scanners etc.
Adv:
* Allows multiple devices to connect on the same bus
* Very versatile across different types of systems
* Backwards compatible in generations
Disadv:
* Requires manual BIOS setup
* No standard software interface to manage/configure the bus.
* Many types with varying speeds/bandwidth making it difficult to choose one for self.
Tasks a CPU must do
Fetch instructions - reads an instruction from memory
Interpret instructions - instruction is decoded to determine what action is required.
Fetch data - The execution of an instruction may require reading data from memory or an I/O module
Process data - The execution of an instruction may require performing some arithmetic or logical operation on data
Write data - the results of an execution may require writing data to memory or an I/O module.
Explain the Control and Program Status registers
* Memory Access Register
Connected to Address bus
Specifies address for read or write operation.
* Memory buffer register
Connected to data bus
Holds data to write, or last data read
* Program Counter
Holds address of next instruction to be fetched
* Instruction register
Holds last instruction fetched/current instruction being executed.
The 32-bit instruction pointer register and the 32-bit flags register combined are considered as the control registers.
Many instructions involve comparisons and mathematical calculations and change the status of the flags and some other conditional instructions test the value of these status flags to take the control flow to other location.
List and explain the bits inside a PSW register
- Sign: Contains the sign bit of the result of the last arithmetic operation.
- Zero: Set when the result is 0.
- Carry: Set if an operation resulted in a carry (addition) into or borrow (subtraction) out of a high-order bit. Used for multiword arithmetic operations.
- Equal: Set if a logical compare result is equality.
- Overflow: Used to indicate arithmetic overflow.
- Interrupt Enable/Disable: Used to enable or disable interrupts.
- Supervisor: Indicates whether the processor is executing in supervisor or user mode. Certain privileged instructions can be executed only in supervisor mode, and certain areas of memory can be accessed only in supervisor mode.
General Registers
AX is the primary accumulator; it is used in input/output and most arithmetic instructions. For example, in multiplication operation, one operand is stored in EAX or AX or AL register according to the size of the operand.
BX is known as the base register, as it could be used in indexed addressing.
CX is known as the count register, as the ECX, CX registers store the loop count in iterative operations.
DX is known as the data register. It is also used in input/output operations. It is also used with AX register along with DX for multiply and divide
operations involving large values.
Pointer Registers
Instruction Pointer (IP) − The 16-bit IP register stores the offset address of the next instruction to be executed. IP in association with the CS register (as CS:IP) gives the complete address of the current instruction in the code segment.
Stack Pointer (SP) − The 16-bit SP register provides the offset value within the program stack. SP in association with the SS register (SS:SP) refers to be current position of data or address within the program stack.
Base Pointer (BP) − The 16-bit BP register mainly helps in referencing the parameter variables passed to a subroutine. The address in SS register is combined with the offset in BP to get the location of the parameter. BP can also be combined with DI and SI as base register for special addressing.
Index Registers
SI and DI, are used for indexed addressing and sometimes used in addition and subtraction.
There are two sets of index pointers −
Source Index (SI) − It is used as source index for string operations.
Destination Index (DI) − It is used as destination index for stringoperations.
Condition Code (Flag) Register Bits
Overflow Flag (OF) − It indicates the overflow of a high-order bit (leftmost bit) of data after a signed arithmetic operation.
Direction Flag (DF) − It determines left or right direction for moving or comparing string data. When the DF value is 0, the string operation takes left-to-right direction and when the value is set to 1, the string operation takes right-to-left direction.
Trap Flag (TF) − It allows setting the operation of the processor in single-step mode. The DEBUG program we used sets the trap flag, so we could step through the execution one instruction at a time.
Sign Flag (SF) − It shows the sign of the result of an arithmetic operation. This flag is set according to the sign of a data item following the arithmetic operation. The sign is indicated by the high-order of leftmost bit. A positive result clears the value of SF to 0 and negative result sets it to 1.
Zero Flag (ZF) − It indicates the result of an arithmetic or comparison operation. A nonzero result clears the zero flag to 0, and a zero result sets it to 1.
Interrupt Flag (IF) − It determines whether the external interrupts like keyboard entry, etc., are to be ignored or processed. It disables the external interrupt when the value is 0 and enables interrupts when set to 1.
Auxiliary Carry Flag (AF) − It contains the carry from bit 3 to bit 4 following an arithmetic operation; used for specialized arithmetic. The AF is set when a 1-byte arithmetic operation causes a carry from bit 3 into bit 4.
Parity Flag (PF) − It indicates the total number of 1-bits in the result obtained from an arithmetic operation. An even number of 1-bits clears the parity flag to 0 and an odd number of 1-bits sets the parity flag to 1.
Carry Flag (CF) − It contains the carry of 0 or 1 from a high-order bit (leftmost) after an arithmetic operation. It also stores the contents of last bit of a shift or rotate operation.
Segment Registers
Segments are specific areas defined in a program for containing data, code and stack. There are three main segments −
Code Segment − It contains all the instructions to be executed. A 16-bit Code Segment register or CS register stores the starting address of the code segment.
Data Segment(DS,ES) − It contains data, constants and work areas. A 16-bit Data Segment register or DS register stores the starting address of the data segment.
Stack Segment − It contains data and return addresses of procedures or subroutines. It is implemented as a ‘stack’ data structure. The Stack Segment register or SS register stores the starting address of the stack.