and Assembly Language
1. Introduction
Computer Organization and Assembly Language are foundational areas
in Computer Science that explain how computers work internally and
how software interacts directly with hardware. Understanding these
topics bridges the gap between hardware and software, allowing
programmers to write efficient, low-level code and comprehend system
performance.
Computer Organization focuses on the structural design and operational
behavior of a computer system. Assembly Language, on the other hand, is
a low-level programming language that provides a symbolic
representation of machine code instructions executed by the CPU.
Why we study Assembly Language:
1. Better/deep understanding of software and hardware interaction
2. Optimization of processing time
3. Embedded Programming
Example to Understand Why we Study Assembly Language:
When we use a mouse and its cursor moves from one place to another, it
shows how hardware interacts with software and how software interacts
with hardware. Similarly, when we type something using the keyboard,
the question arises: where is that typed data stored, how is it processed,
and how is the output generated? Basically, to understand how this
interaction between hardware and software takes place, assembly
language provides a better and deeper understanding.
2. Computer Organization
2.1 Definition
Computer Organization refers to the operational structure and
implementation of the different components of a computer system. It
deals with how hardware components are connected and work together to
execute instructions efficiently.
, In simple terms, it explains how a computer actually runs a program.
2.2 Major Components of Computer Organization
2.2.1 Central Processing Unit (CPU)
The CPU is the brain of the computer that performs arithmetic and logical
operations. It consists of three main parts:
Arithmetic Logic Unit (ALU): Performs mathematical and logical
operations.
Example: Adding two numbers, comparing two values.
Control Unit (CU): Directs operations of the processor by
interpreting instructions.
Example: Fetching and decoding instructions from memory.
Registers: Small, high-speed storage areas for temporary data.
Example: The accumulator register stores intermediate arithmetic
results.
2.2.2 Memory Unit
The memory stores data and instructions required by the CPU. It is
divided into:
Primary Memory (Main Memory): Includes RAM and ROM.
Secondary Memory: Includes hard drives, SSDs, etc.
Example: When running a program, its code and variables are loaded into
RAM for fast access.
2.2.3 Input/Output (I/O) Devices
I/O devices allow communication between the computer and the external
environment.
Input Devices: Keyboard, mouse, scanner.
Output Devices: Monitor, printer, speakers.
Example: When you type a command, the keyboard sends binary signals
to the CPU, which processes and displays the result on the screen.
2.2.4 System Bus
A bus is a communication pathway that transfers data among components
of a computer.