Unit 2 (Data Representation and basic Computer Arithmetic) & 3 Basic Computer Organization and Des
Unit 2 (Data Representation and basic Computer Arithmetic) & 3 Basic Computer Organization and Des
Or
Number systems are methods or systems used to represent numbers. They are fundamental to
mathematics and computing, as they provide ways to count, measure, and perform arithmetic
operations.
1. Decimal
2. Binary
3. Octal
4. Hexadecimal
Decimal System (Base-10): The decimal system, also known as base-10, is the
most familiar number system used by humans. It employs ten symbols: 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9. Each digit's position in a decimal number represents a power of 10.
For instance, in the number 365, the 5 is in the units’ place (100), the 6 is in the tens
place (101), and the 3 is in the hundreds place (102). Decimal numbers are widely
used in everyday life, from counting money to measuring time.
II. Two’s Complement: The twos' complement system addresses the sign
bit problem of ones' complement arithmetic. To find the twos'
complement of a binary number, you invert all the bits and then add 1
to the result. For example, the twos' complement of the binary number
1011 is calculated as follows:
• This representation does not reserve a specific number of bits for the integer
part or the fractional part. Instead it reserves a certain number of bits for the
number (called the mantissa or significand) and a certain number of bits to say
where within that number the decimal place sits (called the exponent).
The floating number representation of a number has two part: the first part
represents a signed fixed point number called mantissa. The second part of
designates the position of the decimal (or binary) point and is called the
exponent. The fixed-point mantissa may be fraction or an integer. Floating -
point is always interpreted to represent a number in the following form: Mxre.
Bus System: a bus system refers to a set of electrical pathways that connect various
components inside a computer. It acts as a communication highway for data, addresses, and
control signals to flow between these components.
OR
a bus system refers to a communication pathway or set of pathways that allows various
components of a computer system to exchange data and control signals. It serves as the central
channel through which information flows between the different parts of the computer, facilitating
coordination and interaction between the processor, memory, input/output devices, and other
peripheral components.
a. Data Bus: This bus carries data between the processor, memory, and other devices.
It enables the transfer of binary information, such as instructions and data values, in
both directions.
b. Address Bus: The address bus is used to specify memory locations or I/O ports for
read and write operations. It carries the address signals generated by the processor to
select the target location for data transfer.
c. Control Bus: The control bus carries various control signals that govern the
operation of the computer system. These signals include commands for memory
read/write operations, interrupt requests, clock signals, and bus arbitration signals.
Instruction Set: An instruction set, also known as an instruction set architecture (ISA), is
a collection of instructions that a computer's central processing unit (CPU) can execute.
These instructions define the operations that the CPU can perform, such as arithmetic
operations, logical operations, data movement, and control flow instructions.
I. Arithmetic Instructions: These instructions perform arithmetic operations
such as addition, subtraction, multiplication, and division. They operate on
data stored in the CPU's registers or in memory.
Timing: Timing in a computer system refers to the coordination of events and operations
based on a clock signal. A clock signal is a periodic electronic signal generated by a clock
circuit that oscillates at a specific frequency, measured in hertz (Hz).The clock signal
serves as a timing reference for various operations within the system, including the
execution of instructions by the CPU, the transfer of data between components, and the
synchronization of internal and external events. Timing considerations are crucial for
ensuring that operations occur at the correct times and that the system operates within
specified performance limits.
I. Fetch: In this stage, the CPU retrieves the next instruction from memory. The
program counter (PC) holds the address of the next instruction to be fetched. The CPU
reads the instruction from memory at the address specified by the program counter
and stores it in a special register called the instruction register (IR).
II. Decode: After fetching the instruction, the CPU decodes it to determine the operation
to be performed and the operands involved. The decoding stage interprets the binary
pattern of the instruction and generates control signals to coordinate subsequent
operations.
III. Execute: In the execution stage, the CPU performs the operation specified by the
decoded instruction. This may involve arithmetic or logical operations, data
movement between registers or memory, or control flow changes such as branching or
jumping to a different part of the program.
IV. Write-back: Finally, if the instruction modifies the contents of registers or memory,
the CPU may update the appropriate data storage locations in the write-back stage.
This stage ensures that any changes made by the instruction are reflected in the
system's state.
Once the instruction cycle is completed for one instruction, the process repeats for the next
instruction in the program. The CPU continuously fetches, decodes, executes, and writes back
instructions until the program completes or encounters a branch or interrupt.
II. Write Memory Reference: A write memory reference involves storing data into
a specific memory address. The CPU sends both the memory address and the data
to be written to the memory controller. The memory controller updates the
contents of the specified memory location with the new data. Write memory
references occur when instructions produce results that need to be stored back
into memory, such as the outcome of arithmetic or logical operations.
Memory references are essential for executing instructions and manipulating data within a
computer system. They enable programs to store and retrieve information from memory,
facilitating the execution of tasks ranging from simple arithmetic operations to complex
computations and data processing.
Input: Input operations involve transferring data from external devices such as keyboards,
mice, or sensors to the computer system. Users interact with software applications through
input devices, providing commands and data to the computer. Input operations are crucial
for enabling user interaction and providing input to software programs for processing.
Output: Output operations involve transferring data from the computer system to external
devices such as monitors, printers, or speakers. Output devices display information
generated by the computer or produce tangible outputs based on computational results.
Output operations are essential for presenting information to users and providing feedback
on the results of computations.