Fundamentals of Computer Organization and Digital Electronics
Fundamentals of Computer Organization and Digital Electronics
Computer Architecture is concerned with the way Computer Organization is concerned with the
hardware components are connected together to structure and behaviour of a computer system as
form a computer system. seen by the user.
It acts as the interface between hardware and It deals with the components of a connection in a
software. system.
Computer Architecture helps us to understand the Computer Organization tells us how exactly all the
functionalities of a system. units in the system are arranged and interconnected.
A programmer can view architecture in terms of Whereas Organization expresses the realization of
instructions, addressing modes and registers. architecture.
While designing a computer system architecture is An organization is done on the basis of architecture.
considered first.
Computer Architecture deals with high-level design Computer Organization deals with low-level design
issues. issues.
Architecture involves Logic (Instruction sets, Organization involves Physical Components (Circuit
Addressing modes, Data types, Cache optimization) design, Adders, Signals, Peripherals)
• Main parts of a computer system:
• Processor: Executes programs
• Main memory: Holds program and data
• I/O devices: For communication with outside
• Control Unit –A control unit (CU) handles all processor control signals.
It directs all input and output flow, fetches the code for instructions
and controlling how data moves around the system.
• Arithmetic and Logic Unit (ALU) –The arithmetic logic unit is that part
of the CPU that handles all the calculations the CPU may need, e.g.
Addition, Subtraction, Comparisons. It performs Logical Operations,
Bit Shifting Operations, and Arithmetic Operation.
Main Memory Unit (Registers) –
• Accumulator: Stores the results of calculations made by ALU.
• Program Counter (PC): Keeps track of the memory location of the next instructions
to be dealt with. The PC then passes this next address to Memory Address Register
(MAR).
• Memory Address Register (MAR): It stores the memory locations of instructions that
need to be fetched from memory or stored into memory.
• Memory Data Register (MDR): It stores instructions fetched from memory or any
data that is to be transferred to, and stored in, memory.
• Current Instruction Register (CIR): It stores the most recently fetched instructions
while it is waiting to be coded and executed.
• The term addressing modes refers to the way in which the operand of
an instruction is specified. The addressing mode specifies a rule for
interpreting or modifying the address field of the instruction before
the operand is actually executed.
• An assembly language program instruction consists of two parts
Addressing modes
• Implied mode::
• In implied addressing the operand is specified in the instruction itself.
In this mode the data is 8 bits or 16 bits long and data is the part of
instruction. .
• Zero address instruction are designed with implied addressing mode.
• Immediate addressing mode (symbol #):
• Example: MOV AL, 35H (move the data 35H into AL register)
• Register mode:
• In register addressing the operand is placed in one of 8 bit or 16 bit
general purpose registers. The data is in the register that is specified
by the instruction.
Here one register reference is required to access the data.
Example: MOV AX,CX (move the contents of CX register to AX register)
• Register Indirect mode:
• In this addressing the operand’s offset is placed in any one of the
registers BX,BP,SI,DI as specified in the instruction. The effective
address of the data is in the base register or an index register that is
specified by the instruction.
Here two register reference is required to access the data.
• MOV AX, [BX] (move the contents of memory location s addressed by
the register BX to the register AX)
• Auto Indexed (increment mode):
• Example:
• Auto decrement mode is same as auto increment mode. Both can also be
used to implement a stack as push and pop . Auto increment and Auto
decrement modes are useful for implementing “Last-In-First-Out” data
structures.
• Direct addressing/ Absolute addressing Mode (symbol [ ]):
• The operand’s offset is given in the instruction as an 8 bit or 16 bit
displacement element. In this addressing mode the 16 bit effective
address of the data is the part of the instruction.
Here only one memory reference operation is required to access the
data.
• Example:ADD AL,[0301] //add the contents of offset address 0301 to
AL
• Indirect addressing Mode (symbol @ or () ):In this mode address
field of instruction contains the address of effective address.
• Here two references are required.
1st reference to get effective address.
2nd reference to access the data.
• Based on the availability of Effective address, Indirect mode is of two
kind:
• Register Indirect:In this mode effective address is in the register, and
corresponding register name will be maintained in the address field of an
instruction.
Here one register reference, one memory reference is required to access the
data.
• Memory Indirect: In this mode effective address is in the memory, and
corresponding memory address will be maintained in the address field of an
instruction.
Here two memory reference is required to access the data.
• Indexed addressing mode: The operand’s offset is the sum of the
content of an index register SI or DI and an 8 bit or 16 bit
displacement.
• Example:MOV AX, [SI +05]
• Characteristic of RISC –
Simpler instruction, hence simple instruction decoding.
Instruction come under size of one word.
Instruction take single clock cycle to get executed.
More number of general purpose register.
Simple Addressing Modes.
Less Data types.
• CISC Complex Instruction Set Architecture :The main idea is that a
single instruction will do all loading, evaluating, and storing
operations just like a multiplication command will do stuff like loading
data, evaluating, and storing it, hence it’s complex.
• Characteristic of CISC –
• Complex instruction, hence complex instruction decoding.
• Instructions are larger than one-word size.
• Instruction may take more than a single clock cycle to get executed.
• Less number of general-purpose registers as operations get
performed in memory itself.
• Complex Addressing Modes.
• More Data types.
• Example – Suppose we have to add two 8-bit numbers:
Can perform only Register to Register Arithmetic Can perform REG to REG or REG to MEM or MEM to
operations MEM
An instruction executed in a single clock cycle Instruction takes more than one clock cycle
An instruction fit in one word Instructions are larger than the size of one word
Hardwired v/s Micro-programmed Control Unit
• Hardwired Control Unit –
• The Execute CycleThe other three cycles(Fetch, Indirect and Interrupt) are simple and
predictable. Each of them requires a simple, small and fixed sequence of micro-operations. In
each case, the same micro-operation is repeated each time around. Execute Cycle is different
from them. Like, for a machine with N different opcodes there are N different sequences of
micro-operations that can occur.
4. Conventional PCI is the other name for PCI. PCI-e is the abbreviated name for PCI Express.
6. PCI provides a slower data rate PCI Express provides faster data rate.
7. The PCI slots are standardized The PCI-e slots depends upon number of lanes.
8. The speed of a PCI slot is upto 133MB/s. The speed of a PCI-e slot is upto 16 GB/s.
10. It may or may not have hot swapping feature. It has the hot swapping feature.
• PCI 32 bits have a transport speed of 33 MHz and work at 132 MBps.
• PCI 64 bits have a transport speed of 33 MHz and work at 264 MBps.
• PCI 64 bits have a transport speed of 66 MHz and work at 512 MBps.
• PCI 64 bits have a transport speed of 66 MHz and work at 1 GBps.
• PCI slots are utilized to install sound cards, Ethernet and remote cards
and presently strong state drives utilizing NVMe(nonvolatile memory
express) innovation to supply SSD (solid-state drives)drive speeds that
are numerous times speedier than SATA SSD speeds.
• When you give some input it will perform computations and produces
output but meanwhile you can interact with the system by
interrupting the running process or you can stop and start another
process
• Disadvantages:
• CPU has to do a lot of work to handle interrupts, resume its previous
execution of programs (in short, overhead required to handle the
interrupt request.).
Number Systems
• Types of Number System
List of Number
Type Base Numbers/Symbols
Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary 2 0, 1
Octal 8 0, 1, 2, 3, 4, 5, 6, 7
Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Binary Numbers
• Used to represent the voltage levels of a digital circuit.
• Only two voltage levels present in a digital circuit, logic High and logic Low.
• The binary numbers represent the logic low as a 0 and the logic high as a 1.
A binary number system is a code that uses only two basic symbols. The
digits can be any two distinct characters, but it should be 0 or 1. The binary
equivalent for some decimal numbers are given below
• Each digit in a binary number has a value or weight. The LSB has a
value of 1. The second from the right has a value of 2, the next 4 ,
etc.,
Decimal Binary Conversion
• A decimal number can be converted to a binary number by
successively dividing the number by 2 as follows:
• Note that the first remainder becomes the most significant bit (MSB).
The last remainder becomes the least significant bit (LSB).
Converting Fractional Decimal Number into
Binary Number
Binary to decimal conversion:
• Fractions: For fractions the weights of the digit positions are written
from right of the binary point and weights are given as follows.
Octal Number System
• Octal number system has a base of 8 i.e., it has eight basic symbols. First eight
decimal digits 0, 1,2,3,4,5,6,7 are used in this system.
• Octal to decimal conversion:
• In the octal number system each digit corresponds to the powers of 8. The
weight of digital position in octal number is as follows.
• To convert from octal to decimal multiply each octal digit by its weight and
add the resulting products.
• Decimal to Octal Conversion
152/8 19 0
19/8 2 3
2/8 0 2
• Step 2:
• Now perform the multiplication of 0.25 and successive fraction with base 8.
• (0.25)10=(2)8
• So, the octal number of the decimal number 152.25 is 230.2
Operation Result carry
0.25×8 0 2
Decimal to octal conversion:
• Here the number is divided by 8 progressively and each time the
remainder is written and finally the remainders are written in the
reverse order to form the octal number. If the number has a fraction
part, that part is multiplied by 8 and carry in the integer part is taken.
Finally the carries are taken in the forward order.
• Octal to binary conversion:
• Since the base of octal number is 8, i.e., the third power of 2, each octal
number is converted into its equivalent binary digit of length three.
• Binary to octal: The given binary number is grouped into a group of 3 bits,
starting at the octal point and each group is converted into its octal
equivalent
Hexadecimal Number System:
• The hexadecimal number system has a base of 16. It has 16 symbols
from 0 through 9 and A through F.
Decimal Hexadecimal Conversion
• A decimal number can be converted to hex number by successively
dividing the number by 16 as follows:
Binary to Hexadecimal conversion
• Ex. : 6EA (16) convert in to binary equivalent.
• i. Write given Hexadecimal number as 6EA(16)
6 E A
if we divide the number 53 by 2, we know the result should be 26.5. However, how
do we represent it if we only had integer representations?
The Binary Point
• The key to represent fractional numbers, like 26.5 above, is the
concept of binary point.
• All digits (or bits) to the left of the binary point carries a weight of 20,
21, 22, and so on. Digits (or bits) on the right of binary point carries a
weight of 2-1, 2-2, 2-3, and so on.
11010.12
represents the value:
5 4 3 2 1 0 -1 -2 -3
2 2 2 2 2 2 2 2 2
... 1 1 0 1 0 1 0 ...
= 1 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 0* 20 + 1 * 2-1
= 16 + 8 + 2 + 0.5
= 26.5
Shifting Is The Key
• bit pattern of 53 and 26.5 is exactly the same. The only difference, is
the position of binary point.
5 4 3 2 1 0 -1 -2 -3
2 2 2 2 2 2 Binary 2 2 2
Point
0 1 1 0 1 0 . 1 0 0
In the case of 26.510, binary point is located one position to the left of 5310:
5 4 3 2 1 0 -1 -2 -3
2 2 2 2 2 2 Binary 2 2 2
Point
1 1 0 1 0 1 . 0 0 0
In general, mathematically, given a fixed binary point position, shifting the bit pattern of
a number to the right by 1 bit always divide the number by 2. Similarly, shifting a
number to the left by 1 bit multiplies the number by 2.
Fixed Point Number Representation
• To define a fixed point type conceptually, all we need are two
parameters:
Note that on a computer, a bit patter can represents anything. Therefore the same bit pattern, if we "cast" it to
another type, such as a fixed<8,5> type, will represents the number:
(000.10110)2
= 1 * 2-1 + 1 * 2-3 + 1 * 2-4
= 0.5 + 0.125 + 0.0625
= 0.6875
If we treat this bit patter as integer, it represents the number:
(10110)2
= 1 * 24 + 1 * 22 + 1 * 21
= 16 + 4 + 2
= 22