Programming C 1.1
Programming C 1.1
Understanding the fundamentals of computers is essential for effectively using modern technology.
This foundational knowledge is the basis for developing advanced skills and applications in
computing.
Fundamentals of Computing
Computers are complex systems composed of both hardware and software. Hardware includes
physical components like the central processing unit (CPU), memory, storage devices, and
input/output devices. Software consists of programs that give these hardware components
functionality.
• Central Processing Unit (CPU): The brain of the computer that performs computations and
manages tasks.
• Memory: Short-term storage (RAM) used for current tasks, and long-term storage (HDD/SSD)
for saving data.
• Input Devices: Devices like keyboards and mice used to input data into the computer.
• Output Devices: Devices like monitors and printers that display or produce the results of
computations.
• Application Software: Programs that help users perform specific tasks (e.g., word processors,
web browsers).
• System Software: Software that manages the hardware and provides a platform for
applications (e.g., operating systems, compilers).
Introduction to Computers
Computers have become ubiquitous in our lives, from managing emails to performing complex
calculations. They are integral to various aspects of daily life, including work, education, and
entertainment.
Computer Organization:
• Components: Includes memory address registers (MAR), memory buffer registers (MBR),
program counters (PC), and instruction registers (IR).
Instructions are fundamental units of machine language programs that guide the CPU’s operations.
Each instruction includes:
• Address Field: The location where the operation will take place.
Instruction Cycle:
Types of Instructions
2. Input-Output Instructions: Manage data transfer between the CPU and external devices.
Addressing Modes
Addressing modes determine how the CPU locates the operands for instructions:
• Implied Addressing Mode: The operation is defined within the instruction itself. o
• Direct Addressing Mode: The instruction specifies the memory address directly.
o Example: MOV AL, [0400] (moves data from memory address 0400 to register AL).
• Indirect Addressing Mode: The instruction specifies a memory address that contains the
address of the actual data.
o Example: LOAD AL, @400 (loads data from the address found at location 400 into
register AL).
• Indexed Addressing Mode: Uses an index register to find the operand's address.
o Example: Fetching rows from a database, where each row's address is incremented
automatically.
Bus System
A system bus connects the CPU to other components within the computer and allows data transfer
between them.
Types of Buses:
2. Address Bus: Provides information about where data should be read from or written to.
3. Control Bus: Manages the timing and control signals needed for data transfer.
Bus Types:
• Synchronous Bus: Operates in sync with the computer's clock, allowing high-speed data
transfer.