0% found this document useful (0 votes)
12 views33 pages

11. Computer Organization and Architecture

Uploaded by

kidusyared455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views33 pages

11. Computer Organization and Architecture

Uploaded by

kidusyared455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Part II: Computer Organization and Architecture

Module Objective
On completion of the module successfully, students will be able to:
 Carry out design and development of complex elements, such as user interfaces,
multiprocessing, and fault-tolerant components;
 Describe the basic structure and operation of a digital computer
 Explain in detail the operation of the arithmetic unit including the algorithms &
implementation of fixed-point and floating-point addition, subtraction, multiplication &
division.
 Identify different ways of communicating with I/O devices and standard I/O interfaces.
 Describe different performance enhancement of computer architecture
 Explain the basic structure of computer hardware & software
 Identify the processes involved in the basic operations of CPU
 Demonstrate basic concepts of circuits and their design

2.1. Introduction
Computer organization
 Design of the components and functional blocks using which computer systems
are built.
 Analogy: civil engineers task during building construction (cement, bricks, iron
rod and other building materials)
Computer Architecture
 How to integrate the components to build the computer system to achieve a desire
level of performance?
 Analogy: Architects task during the planning of a building (overall layout, floor
plan etc.)
Computer architecture comprises rules, methods, and procedures that describe the execution
and functionality of the entire computer system. In general terms, computer architecture refers to
how a computer system is designed using compatible technologies. This article will tell you how
computer architecture is classified into a disciplinary method.

Page 86 of 248
The term architecture in computer literature signifies the efforts of Sir Lyle R. Johnson and Sir
Frederick P. Brooks, members of the Machine Organization department, in 1959. Sir Johnson
noted his description of formats, instruction types, hardware limitations, along with speed
improvements. These were at the level of system architecture, a term that is more useful than
machine organization. Succeedingly, a computer user can use that term in many less precise
methods.
Earlier, computer architects designed computer architecture on paper. It was then directly built
into a final hardware form. Later, they assembled computer architecture designs materially in the
form of transistor-transistor logic (TTL) computers. By the 1990s, new computer architectures
are typically built, examined, and tweaked inside another computer architecture, in a computer
architecture simulator, or the interior part of an FPGA, as a microprocessor before perpetrating to
the ultimate hardware form.

2.1.1. Types of computer Architecture


Here are the various categories of architecture that exist in our computer systems.
 Von-Neumann Architecture
 Harvard Architecture
 Instruction Set Architecture
 Micro-architecture
 System Design
John von Neumann coined and developed this architecture. The computer we are using
nowadays is based on the von Neumann architecture. It has some concepts. It is also known as
Princeton architecture. It renders a unique design for the electronic digital systems having the
following components:
A Central Processing Unit (CPU) with arithmetic and logic unit (ALU) and processors with
attached registers.
A memory that can store data and instructions.
External mass storage or secondary storage.
A Control Unit (CU) with the ability to hold instructions in the program counter (PC) or
instruction register (IR).

Page 87 of 248
Input and output mechanisms and peripherals.
The von Neumann design thus constitutes the foundation of modern computing. The Harvard
architecture, a similar model, had committed data addresses and buses for reading and writing to
memory. It wins because von Neumann's architecture was easier to execute in real hardware.

2.1.2. Logic gates and Boolean algebra

Logic Gates
 The logic gates are the main structural part of a digital system.
 Logic Gates are a block of hardware that produces signals of binary 1 or 0 when input
logic requirements are satisfied.
 Each gate has a distinct graphic symbol, and its operation can be described by means of
algebraic expressions.
 The seven basic logic gates include: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
 The relationship between the input-output binary variables for each gate can be
represented in tabular form by a truth table.
 Each gate has one or two binary input variables designated by A and B and one binary
AND GATE:
o The AND gate is an electronic circuit which gives a high output only if all its inputs are
high. The AND operation is represented by a dot (.) sign.
o output variable designated by x.

OR GATE:
The OR gate is an electronic circuit which gives a high output if one or more of its inputs are
high. The operation performed by an OR gate is represented by a plus (+) sign.

Page 88 of 248
NOT GATE:
The NOT gate is an electronic circuit which produces an inverted version of the input at its
output. It is also known as an Inverter.
NAND GATE:
The NOT-AND (NAND) gate which is equal to an AND gate followed by a NOT gate. The
NAND gate gives a high output if any of the inputs are low. The NAND gate is represented by a
AND gate with a small circle on the output. The small circle represents inversion.

NOR GATE:
The NOT-OR (NOR) gate which is equal to an OR gate followed by a NOT gate. The NOR gate
gives a low output if any of the inputs are high. The NOR gate is represented by an OR gate with
a small circle on the output. The small circle represents inversion.

Page 89 of 248
Exclu
sive-OR/ XOR GATE:
The 'Exclusive-OR' gate is a circuit which will give a high output if one of its inputs is high but
not both of them. The XOR operation is represented by an encircled plus sign.

EXCLUSIVE-NOR/Equivalence GATE:
The 'Exclusive-NOR' gate is a circuit that does the inverse operation to the XOR gate. It will
give a low output if one of its inputs is high but not both of them. The small circle represents
inversion

Page 90 of 248
Basic gates
The OR, AND, and NOT are the three basic logic gates as they together can construct the logic
circuit for any given Boolean expression.
Derived gates
The logic gates which are derived from the basic gates such as AND, OR, NOT gates are called
derived gates. These derived gates have their own unique Symbols, Truth Tables and Boolean
Expressions. Here we will explore the most common derived gates such as NAND Gate, NOR
Gate, EX-OR Gate, and EX-NOR Gate
Universal gate
A universal gate is a gate which can implement any Boolean function without need to use any
other gate type. The NAND and NOR gates are universal gates. In practice, this is advantageous
since NAND and NOR gates are economical and easier to fabricate and are the basic gates used
in all IC digital logic families.
Boolean algebra
Boolean algebra can be considered as an algebra that deals with binary variables and logic
operations. Boolean algebraic variables are designated by letters such as A, B, x, and y. The
basic operations performed are AND, OR, and complement.
The Boolean algebraic functions are mostly expressed with binary variables, logic operation
symbols, parentheses, and equal sign. For a given value of variables, the Boolean function can be
either 1 or 0. For instance, consider the Boolean function:
F = x + y'z
The logic diagram for the Boolean function F = x + y'z can be represented as:

Page 91 of 248
 The Boolean function F = x + y'z is transformed from an algebraic expression into a logic
diagram composed of AND, OR, and inverter gates.
 Inverter at input 'y' generates its complement y'.
 There is an AND gate for the term y'z, and an OR gate is used to combine the two terms
(x and y'z).
 The variables of the function are taken to be the inputs of the circuit, and the variable
symbol of the function is taken as the output of the circuit.

The truth table for the Boolean function F = x + y'z can be represented as:

Combinational Circuits
A combinational circuit comprises of logic gates whose outputs at any time are determined
directly from the present combination of inputs without any regard to previous inputs. A
combinational circuit performs a specific information-processing operation fully specified
logically by a set of Boolean functions. The basic components of a combinational circuit are:
input variables, logic gates, and output variables.

Page 92 of 248
In our previous sections, we learned about combinational circuit and their working. The
combinational circuits have set of outputs, which depends only on the present combination of
inputs. Below is the block diagram of the synchronous logic circuit.
Examples of combinational circuits: Adder, Subtractor, Converter, and Encoder/Decoder,
multiplexer/de-multiplexer

The 'n' input variables come from an external source whereas the 'm' output variables go to an
external destination. In many applications, the source or destination are storage registers.
Decoder
The combinational circuit that change the binary information into 2N output lines is known
as Decoders. The binary information is passed in the form of N input lines. The output lines
define the 2N-bit code for the binary information. In simple words, the Decoder performs the
reverse operation of the Encoder. At a time, only one input line is activated for simplicity. The
produced 2N-bit output code is equivalent to the binary information.
Encoders
The combinational circuits that change the binary information into N output lines are known
as Encoders. The binary information is passed in the form of 2N input lines. The output lines
define the N-bit code for the binary information. In simple words, the Encoder performs the
reverse operation of the Decoder. At a time, only one input line is activated for simplicity. The
produced N-bit output code is equivalent to the binary information.
Multiplexer
A multiplexer is a combinational circuit that has 2n input lines and a single output line. Simply,
the multiplexer is a multi-input and single-output combinational circuit. The binary information
is received from the input lines and directed to the output line. On the basis of the values of the
selection lines, one of these data inputs will be connected to the output.

Page 93 of 248
Unlike encoder and decoder, there are n selection lines and 2n input lines. So, there is a total of
2N possible combinations of inputs. A multiplexer is also treated as Mux.
De-multiplexer
A De-multiplexer is a combinational circuit that has only 1 input line and 2N output lines.
Simply, the multiplexer is a single-input and multi-output combinational circuit. The information
is received from the single input lines and directed to the output line. On the basis of the values
of the selection lines, the input will be connected to one of these outputs. De-multiplexer is
opposite to the multiplexer.
Unlike encoder and decoder, there are n selection lines and 2n outputs. So, there is a total of
2n possible combinations of inputs. De-multiplexer is also treated as De-mux.
Sequential circuits
The sequential circuit is a special type of circuit that has a series of inputs and outputs. The
outputs of the sequential circuits depend on both the combination of present inputs and previous
outputs. The previous output is treated as the present state. So, the sequential circuit contains the
combinational circuit and its memory storage elements. A sequential circuit doesn't need to
always contain a combinational circuit. So, the sequential circuit can contain only the memory
element.

Page 94 of 248
Difference between the combinational circuits and sequential circuits are given below:

Sequential circuits refer to the combinational logic circuits that consist of input variables (X)
and logic gates (or Computational circuits) along with the output variable (Z).
For example, flip-flops, counter, register, clocks,

2.1.3. Types of Sequential Circuits


Asynchronous sequential circuits
The clock signals are not used by the Asynchronous sequential circuits. The asynchronous
circuit is operated through the pulses. So, the changes in the input can change the state of the
circuit. The asynchronous circuits do not use clock pulses. The internal state is changed when the
input variable is changed. The un-clocked flip-flops or time-delayed are the memory elements of
asynchronous sequential circuits. The asynchronous sequential circuit is similar to the
combinational circuits with feedback.
Synchronous sequential circuits
In synchronous sequential circuits, synchronization of the memory element's state is done by
the clock signal. The output is stored in either flip-flops or latches (memory devices). The

Page 95 of 248
synchronization of the outputs is done with either only negative edges of the clock signal or only
positive edges.
Clock Signal and Triggering
Clock signal
A clock signal is a periodic signal in which ON time and OFF time need not be the same. When
ON time and OFF time of the clock signal are the same, a square wave is used to represent the
clock signal. Below is a diagram which represents the clock signal:

A clock signal is considered as the square wave. Sometimes, the signal stays at logic, either high
5V or low 0V, to an equal amount of time. It repeats with a certain time period, which will be
equal to twice the 'ON time' or 'OFF time'.
Types of Triggering
These are two types of triggering in sequential circuits:
Level triggering
The logic High and logic Low are the two levels in the clock signal. In level triggering, when the
clock pulse is at a particular level, only then the circuit is activated. There are the following types
of level triggering:
Positive level triggering
In a positive level triggering, the signal with Logic High occurs. So, in this triggering, the circuit
is operated with such type of clock signal. Below is the diagram of positive level triggering:

Page 96 of 248
Negative level triggering
In negative level triggering, the signal with Logic Low occurs. So, in this triggering, the circuit is
operated with such type of clock signal. Below is the diagram of Negative level triggering:

Edge triggering
In clock signal of edge triggering, two types of transitions occur, i.e., transition either from Logic
Low to Logic High or Logic High to Logic Low.
Based on the transitions of the clock signal, there are the following types of edge triggering:
Positive edge triggering
The transition from Logic Low to Logic High occurs in the clock signal of positive edge
triggering. So, in positive edge triggering, the circuit is operated with such type of clock signal.
The diagram of positive edge triggering is given below.

Negative edge triggering


The transition from Logic High to Logic low occurs in the clock signal of negative edge
triggering. So, in negative edge triggering, the circuit is operated with such type of clock signal.
The diagram of negative edge triggering is given below.

Counters
A special type of sequential circuit used to count the pulse is known as a counter, or a collection
of flip flops where the clock signal is applied is known as counters.

Page 97 of 248
The counter is one of the widest applications of the flip flop. Based on the clock pulse, the output
of the counter contains a predefined state. The number of the pulse can be counted using the
output of the counter.
There are the following types of counters:
o Asynchronous Counters
o Synchronous Counters
Asynchronous or ripple counters
The Asynchronous counter is also known as the ripple counter. Below is a diagram of the 2-
bit Asynchronous counter in which we used two T flip-flops. Apart from the T flip flop, we can
also use the JK flip flop by setting both of the inputs to 1 permanently. The external clock pass to
the clock input of the first flip flop, i.e., FF-A and its output, i.e., is passed to clock input of the
next flip flop, i.e., FF-B.
Synchronous counters
In the Asynchronous counter, the present counter's output passes to the input of the next
counter. So, the counters are connected like a chain. The drawback of this system is that it
creates the counting delay, and the propagation delay also occurs during the counting stage.
The synchronous counter is designed to remove this drawback.
In the synchronous counter, the same clock pulse is passed to the clock input of all the flip
flops. The clock signals produced by all the flip flops are the same as each other. Below is the
diagram of a 2-bit synchronous counter in which the inputs of the first flip flop, i.e., FF-A, are
set to 1. So, the first flip flop will work as a toggle flip-flop. The output of the first flip flop is
passed to both the inputs of the next JK flip flop.
Ripple Counter
Ripple counter is a special type of Asynchronous counter in which the clock pulse ripples
through the circuit. The n-MOD ripple counter forms by combining n number of flip-flops. The
n-MOD ripple counter can count 2n states, and then the counter resets to its initial value.
Features of the Ripple Counter:
o Different types of flip flops with different clock pulse are used.
o It is an example of an asynchronous counter.
o The flip flops are used in toggle mode.
o The external clock pulse is applied to only one flip flop. The output of this flip flop is
treated as a clock pulse for the next flip flop.

Page 98 of 248
o In counting sequence, the flip flop in which external clock pulse is passed, act as LSB.
Latches
A Latch is a special type of logical circuit. The latches have low and high two stable states. Due
to these states, latches also refer to as bistable-multivibrators. A latch is a storage device that
holds the data using the feedback lane. The latch stores 1 -bit until the device set to 1. The latch
changes the stored data and constantly trials the inputs when the enable input set to 1.
Based on the enable signal, the circuit works in two states. When the enable input is high, then
both the inputs are low, and when the enable input is low, both the inputs are high.

2.1.4. Types of Latches


There are various types of latches used in digital circuits which are as follows:
o SR Latch
o Gated S-R Latch
o D latch
o Gated D Latch
o JK Latch
o T Latch.
Basics of Flip Flop
A flip-flop is a device which stores a single bit (binary digit) of data; one of its two states
represents a "one" and the other represents a "zero". Such data storage can be used for storage of
state, and such a circuit is described as sequential logic in electronics.
There are basically four different types of flip flops and these are:
Set-Reset (SR) flip-flop or Latch.
The S-R flip flop is the most common flip flop used in the digital system. In SR flip flop, when
the set input "S" is true, the output Y will be high, and Y' will be low. It is required that the
wiring of the circuit is maintained when the outputs are established. We maintain the wiring until
set or reset input goes high, or power is shutdown.
JK flip-flop.
The JK flip flop is used to remove the drawback of the S-R flip flop, i.e., undefined states. The
JK flip flop is formed by doing modification in the SR flip flop. The S-R flip flop is improved in
order to construct the J-K flip flop. When S and R input is set to true, the SR flip flop gives an
inaccurate result. But in the case of JK flip flop, it gives the correct output.

Page 99 of 248
D (Data or Delay) flip-flop.
D flip flop is a widely used flip flop in digital systems. The D flip flop is mostly used in shift-
registers, counters, and input synchronization.
T (Toggle) flip-flop.
Just like JK flip-flop, T flip flop is used. Unlike JK flip flop, in T flip flop, there is only single
input with the clock input. The T flip flop is constructed by connecting both of the inputs of JK
flip flop together as a single input.

2.1.5. Number System


In a digital system, the system can understand only the optional number system. In these
systems, digits symbols are used to represent different values, depending on the index from
which it settled in the number system.
In simple terms, for representing the information, we use the number system in the digital system
The digit value in the number system is calculated using:
1. The digit
2. The index, where the digit is present in the number.
3. Finally, the base numbers, the total number of digits available in the number system.
Types of Number System
In the digital computer, there are various types of number systems used for representing
information.
1. Binary Number System
2. Decimal Number System
3. Hexadecimal Number System
4. Octal Number System
Binary Number System
Generally, a binary number system is used in the digital computers. In this number system, it
carries only two digits, either 0 or 1. There are two types of electronic pulses present in a binary
number system. The first one is the absence of an electronic pulse representing '0'and second one
is the presence of electronic pulse representing '1'. Each digit is known as a bit. A four-bit
collection (1101) is known as a nibble, and a collection of eight bits (11001010) is known as a
byte. The location of a digit in a binary number represents a specific power of the base (2) of the
number system.

Page 100 of 248


Characteristics:
1. It holds only two values, i.e., either 0 or 1.
2. It is also known as the base 2 number system.
3. The position of a digit represents the 0 power of the base(2). Example: 20
4. The position of the last digit represents the x power of the base (2). Example: 2x, where x
represents the last position, i.e., 1

Examples:
(10100)2, (11011)2, (11001)2, (000101)2, (011010)2.
Decimal Number System
The decimal numbers are used in our day to day life. The decimal number system contains ten
digits from 0 to 9(base 10). Here, the successive place value or position, left to the decimal point
holds units, tens, hundreds, thousands, and so on.
The position in the decimal number system specifies the power of the base (10). The 0 is the
minimum value of the digit, and 9 is the maximum value of the digit. For example, the decimal
number 2541 consist of the digit 1 in the unit position, 4 in the tens position, 5 in the hundreds
position, and 2 in the thousand positions and the value will be written as:
(2×1000) + (5×100) + (4×10) + (1×1)
(2×103) + (5×102) + (4×101) + (1×100)
2000 + 500 + 40 + 1
2541
Octal Number System
The octal number system has base 8(means it has only eight digits from 0 to 7). There are only
eight possible digit values to represent a number. With the help of only three bits, an octal
number is represented. Each set of bits has a distinct value between 0 and 7.
Below, we have described certain characteristics of the octal number system:
Characteristics:
1. An octal number system carries eight digits starting from 0, 1, 2, 3, 4, 5, 6, and 7.
2. It is also known as the base 8 number system.
3. The position of a digit represents the 0 power of the base (8). Example: 80
4. The position of the last digit represents the x power of the base (8). Example: 8x, where x
represents the last position, i.e., 1

Page 101 of 248


Examples:
(273)8, (5644)8, (0.5365)8, (1123)8, (1223)8.
Hexadecimal Number System
It is another technique to represent the number in the digital system called the hexadecimal
number system. The number system has a base of 16 means there are total 16 symbols (0, 1, 2, 3,
4, 5, 6, 7, 8, 9, A, B, C, D, E, F) used for representing a number. The single-bit representation of
decimal values10, 11, 12, 13, 14, and 15 are represented by A, B, C, D, E, and F. Only 4 bits are
required for representing a number in a hexadecimal number. Each set of bits has a distinct value
between 0 and 15. There are the following characteristics of the octal number system:
Characteristics:
1. It has ten digits from 0 to 9 and 6 letters from A to F.
2. The letters from A to F defines numbers from 10 to 15.
3. It is also known as the base 16number system.
4. In hexadecimal number, the position of a digit represents the 0 power of the base(16).
Example: 160
5. In hexadecimal number, the position of the last digit represents the x power of the
base(16). Example: 16x, where x represents the last position, i.e., 1

Page 102 of 248


Examples:
(FAC2)16, (564)16, (0ABD5)16, (1123)16, (11F3)16.
Number Base Conversion
In our previous section, we learned different types of number systems such as binary, decimal,
octal, and hexadecimal. In this part of the tutorial, we will learn how we can change a number
from one number system to another number system.
As, we have four types of number systems so each one can be converted into the remaining three
systems. There are the following conversions possible in Number System
1. Binary to other Number Systems.
2. Decimal to other Number Systems.
3. Octal to other Number Systems.
4. Hexadecimal to other Number Systems.

Page 103 of 248


Binary to other Number Systems
There are three conversions possible for binary number, i.e., binary to decimal, binary to octal,
and binary to hexadecimal. The conversion process of a binary number to decimal differs from
the remaining others. Let's take a detailed discussion on Binary Number System conversion.
Binary to Decimal Conversion
The process of converting binary to decimal is quite simple. The process starts from multiplying
the bits of binary number with its corresponding positional weights. And lastly, we add all those
products.
Let's take an example to understand how the conversion is done from binary to decimal.
Example 1: (10110.001)2
We multiplied each bit of (10110.001)2 with its respective positional weight, and last we add the
products of all the bits with its weight.
(10110.001)2 = (1×24)+(0×23)+(1×22)+(1×21)+(0×20)+
(0×2-1)+(0×2-2)+(1×2-3)
(10110.001)2 = (1×16)+(0×8)+(1×4)+(1×2)+(0×1)+
(0×1⁄2)+(0×1⁄4)+(1×1⁄8)
(10110.001)2 = 16+0+4+2+0+0+0+0.125
(10110.001)2 = (22.125 )10

Page 104 of 248


Binary to Octal Conversion
The base numbers of binary and octal are 2 and 8, respectively. In a binary number, the pair of
three bits is equal to one octal digit. There are only two steps to convert a binary number into an
octal number which are as follows:
In the first step, we have to make the pairs of three bits on both sides of the binary point. If there
will be one or two bits left in a pair of three bits pair, we add the required number of zeros on
extreme sides.
In the second step, we write the octal digits corresponding to each pair.
Example 1: (111110101011.0011)2
1. Firstly, we make pairs of three bits on both sides of the binary point.
111 110 101 011.001 1
On the right side of the binary point, the last pair has only one bit. To make it a complete pair of
three bits, we added two zeros on the extreme side.
111 110 101 011.001 100
2. Then, we wrote the octal digits, which correspond to each pair.
(111110101011.0011)2 = (7653.14)8
Binary to Hexadecimal Conversion
The base numbers of binary and hexadecimal are 2 and 16, respectively. In a binary number, the
pair of four bits is equal to one hexadecimal digit. There are also only two steps to convert a
binary number into a hexadecimal number which are as follows:
1. In the first step, we have to make the pairs of four bits on both sides of the binary point. If
there will be one, two, or three bits left in a pair of four bits pair, we add the required number
of zeros on extreme sides.
2. In the second step, we write the hexadecimal digits corresponding to each pair.
Example 1: (10110101011.0011)2
1. Firstly, we make pairs of four bits on both sides of the binary point.
111 1010 1011.0011
On the left side of the binary point, the first pair has three bits. To make it a complete pair of four
bits, add one zero on the extreme side.
0111 1010 1011.0011
2. Then, we write the hexadecimal digits, which correspond to each pair.
(011110101011.0011)2=(7AB.3)16

Page 105 of 248


Decimal to other Number System
The decimal number can be an integer or floating-point integer. When the decimal number is a
floating-point integer, then we convert both part (integer and fractional) of the decimal number
in the isolated form(individually). There are the following steps that are used to convert the
decimal number into a similar number of any base 'r'.
1. In the first step, we perform the division operation on integer and successive part with
base 'r'. We will list down all the remainders till the quotient is zero. Then we find out the
remainders in reverse order for getting the integer part of the equivalent number of base 'r'.
In this, the least and most significant digits are denoted by the first and the last remainders.
2. In the next step, the multiplication operation is done with base 'r' of the fractional and
successive fraction. The carries are noted until the result is zero or when the required number
of the equivalent digit is obtained. For getting the fractional part of the equivalent number of
base 'r', the normal sequence of carrying is considered.
Decimal to Binary Conversion
For converting decimal to binary, there are two steps required to perform, which are as follows:
1. In the first step, we perform the division operation on the integer and the successive quotient
with the base of binary(2).
2. Next, we perform the multiplication on the integer and the successive quotient with the base
of binary(2).
Example 1: (152.25)10
Step 1:
Divide the number 152 and its successive quotients with base 2.
(152)10=(10011000)2
Step 2:
Now, perform the multiplication of 0.27 and successive fraction with base 2.

Page 106 of 248


(152)10=(10011000)2
Step 2:
Now, perform the multiplication of 0.27 and successive fraction with base 2.

(0.25)10 = (.01)2
Decimal to Octal Conversion
For converting decimal to octal, there are two steps required to perform, which are as follows:
1. In the first step, we perform the division operation on the integer and the successive quotient
with the base of octal(8).
2. Next, we perform the multiplication on the integer and the successive quotient with the base
of octal (8).
Example 1: (152.25)10
Step 1:
Divide the number 152 and its successive quotients with base 8.

Page 107 of 248


(0.25)10=(2)8
So, the octal number of the decimal number 152.25 is 230.2
Decimal to hexadecimal conversion
For converting decimal to hexadecimal, there are two steps required to perform, which are as
follows:
1. In the first step, we perform the division operation on the integer and the successive
quotient with the base of hexadecimal (16).
2. Next, we perform the multiplication on the integer and the successive quotient with the
base of hexadecimal (16).
Example 1: (152.25)10
Step 1:
Divide the number 152 and its successive quotients with base 8.

Page 108 of 248


(0.25)10=(4)16
So, the hexadecimal number of the decimal number 152.25 is 230.4.
Octal to other Number System
Like binary and decimal, the octal number can also be converted into other number systems. The
process of converting octal to decimal differs from the remaining one. Let's start understanding
how conversion is done.
Octal to Decimal Conversion
The process of converting octal to decimal is the same as binary to decimal. The process starts
from multiplying the digits of octal numbers with its corresponding positional weights. And
lastly, we add all those products.
Let's take an example to understand how the conversion is done from octal to decimal.
Example 1: (152.25)8
Step 1:
We multiply each digit of 152.25 with its respective positional weight, and last we add the
products of all the bits with its weight.
(152.25)8=(1×82)+(5×81)+(2×80)+(2×8-1)+(5×8-2)
(152.25)8=64+40+2+(2×1⁄8)+(5×1⁄64)
(152.25)8=64+40+2+0.25+0.078125
(152.25)8=106.328125

Page 109 of 248


So, the decimal number of the octal number 152.25 is 106.328125
Octal to Binary Conversion
The process of converting octal to binary is the reverse process of binary to octal. We write the
three bits binary code of each octal number digit.
Example 1: (152.25)8
We write the three-bit binary digit for 1, 5, 2, and 5.
(152.25)8=(001101010.010101)2
So, the binary number of the octal number 152.25 is (001101010.010101)2
Octal to hexadecimal conversion
For converting octal to hexadecimal, there are two steps required to perform, which are as
follows:
1. In the first step, we will find the binary equivalent of number 25.
2. Next, we have to make the pairs of four bits on both sides of the binary point. If there will
be one, two, or three bits left in a pair of four bits pair, we add the required number of zeros
on extreme sides and write the hexadecimal digits corresponding to each pair.
Example 1: (152.25)8
Step 1:
We write the three-bit binary digit for 1, 5, 2, and 5.
(152.25)8=(001101010.010101)2
So, the binary number of the octal number 152.25 is (001101010.010101)2
Step 2:
1. Now, we make pairs of four bits on both sides of the binary point.
0 0110 1010.0101 01
On the left side of the binary point, the first pair has only one digit, and on the right side, the last
pair has only two-digit. To make them complete pairs of four bits, add zeros on extreme sides.
0000 0110 1010.0101 0100
2. Now, we write the hexadecimal digits, which correspond to each pair.
(0000 0110 1010.0101 0100)2=(6A.54)16
Hexa-decimal to other Number System
Like binary, decimal, and octal, hexadecimal numbers can also be converted into other number
systems. The process of converting hexadecimal to decimal differs from the remaining one. Let's
start understanding how conversion is done.

Page 110 of 248


Hexa-decimal to Decimal Conversion
The process of converting hexadecimal to decimal is the same as binary to decimal. The process
starts from multiplying the digits of hexadecimal numbers with its corresponding positional
weights. And lastly, we add all those products.
Let's take an example to understand how the conversion is done from hexadecimal to decimal.
Example 1: (152A.25)16
Step 1:
We multiply each digit of 152A.25 with its respective positional weight, and last we add the
products of all the bits with its weight.
(152A.25)16=(1×163)+(5×162)+(2×161)+(A×160)+(2×16-1)+(5×16-2)
(152A.25)16=(1×4096)+(5×256)+(2×16)+(10×1)+(2×16-1)+(5×16-2)
(152A.25)16=4096+1280+32+10+(2×1⁄16)+(5×1⁄256)
(152A.25)16=5418+0.125+0.125
(152A.25)16=5418.14453125
So, the decimal number of the hexadecimal number 152A.25 is 5418.14453125
Hexadecimal to Binary Conversion
The process of converting hexadecimal to binary is the reverse process of binary to hexadecimal.
We write the four bits binary code of each hexadecimal number digit.
Example 1: (152A.25)16
We write the four-bit binary digit for 1, 5, A, 2, and 5.
(152A.25)16=(0001 0101 0010 1010.0010 0101)2
So Step 2:
3. Then, we make pairs of three bits on both sides of the binary point.
001 010 100 101 010.001 001 010
4. Then, we write the octal digit, which corresponds to each pair.
(001010100101010.001001010)2=(12452.112)8
So, the octal number of the hexadecimal number 152A.25 is 12452.112
, the binary number of the hexadecimal number 152.25 is (1010100101010.00100101)2

Page 111 of 248


Hexadecimal to Octal Conversion
For converting hexadecimal to octal, there are two steps required to perform, which are as
follows:
1. In the first step, we will find the binary equivalent of the hexadecimal number.
2. Next, we have to make the pairs of three bits on both sides of the binary point. If there
will be one or two bits left in a pair of three bits pair, we add the required number of
zeros on extreme sides and write the octal digits corresponding to each pair.
Example 1: (152A.25)16
Step 1:
We write the four-bit binary digit for 1, 5, 2, A, and 5.
(152A.25)16=(0001 0101 0010 1010.0010 0101)2
So, the binary number of hexadecimal number 152A.25 is (0011010101010.010101)2
Step 2:
3. Then, we make pairs of three bits on both sides of the binary point.
001 010 100 101 010.001 001 010
4. Then, we write the octal digit, which corresponds to each pair.
(001010100101010.001001010)2=(12452.112)8
So, the octal number of the hexadecimal number 152A.25 is 12452.112
Gray Code
The Gray Code is a sequence of binary number systems, which is also known as reflected binary
code. The reason for calling this code as reflected binary code is the first N/2 values compared
with those of the last N/2 values in reverse order. In this code, two consecutive values are
differed by one bit of binary digits. Gray codes are used in the general sequence of hardware-
generated binary numbers. These numbers cause ambiguities or errors when the transition from
one number to its successive is done. This code simply solves this problem by changing only one
bit when the transition is between numbers is done.
The gray code is a very light weighted code because it doesn't depend on the value of the digit
specified by the position. This code is also called a cyclic variable code as the transition of one
value to its successive value carries a change of one bit only.
How to generate Gray code?
The prefix and reflect method are recursively used to generate the Gray code of a number. For
generating gray code:

Page 112 of 248


1. We find the number of bits required to represent a number.
2. Next, we find the code for 0, i.e., 0000, which is the same as binary.
3. Now, we take the previous code, i.e., 0000, and change the most significant bit of it.
4. We perform this process reclusively until all the codes are not uniquely identified.
5. If by changing the most significant bit, we find the same code obtained previously, then
the second most significant bit will be changed, and so on.

Page 113 of 248


2.1.6. Register transfer languages
Digital System: An interconnection of hardware modules that do a certain task on the
information.
Registers + Operations performed on the data stored in them = Digital Module
Modules are interconnected with common data and control paths to form a digital computer
system
Register Transfer Language (RTL) :
 a symbolic notation to describe the microoperation transfers among registers
Next steps:
 Define symbols for various types of microoperations,
 Describe the hardware that implements these microoperations

Page 114 of 248


Micro operations

The microoperations most often encountered in digital computers are classified into four
categories:
 Register transfer microoperations
 Arithmetic microoperations (on numeric data stored in the registers)
 Logic microoperations (bit manipulations on non-numeric data)
 Shift microoperations
Flynn's Classification of Computers
M.J. Flynn proposed a classification for the organization of a computer system by the number of
instructions and data items that are manipulated simultaneously.
The sequence of instructions read from memory constitutes an instruction stream.
The operations performed on the data in the processor constitute a data stream.

Flynn's classification divides computers into four major groups that are:
1. Single instruction stream, single data stream (SISD)
2. Single instruction stream, multiple data stream (SIMD)
3. Multiple instruction stream, single data stream (MISD)
4. Multiple instruction stream, multiple data stream (MIMD)
Flynn's classification of Computers

Page 115 of 248


2.1.7. Computer Registers
Registers are a type of computer memory used to quickly accept, store, and transfer data and
instructions that are being used immediately by the CPU. The registers used by the CPU are
often termed as Processor registers. A processor register may hold an instruction, a storage
address, or any data (such as bit sequence or individual characters).
The computer needs processor registers for manipulating data and a register for holding a
memory address. The register holding the memory location is used to calculate the address of the
next instruction after the execution of the current instruction is completed.
Following is the list of some of the most common registers used in a basic computer:

Page 116 of 248


o The Memory unit has a capacity of 4096 words, and each word contains 16 bits.
o The Data Register (DR) contains 16 bits which hold the operand read from the memory
location.
o The Memory Address Register (MAR) contains 12 bits which hold the address for the
memory location.
o The Program Counter (PC) also contains 12 bits which hold the address of the next
instruction to be read from memory after the current instruction is executed.
o The Accumulator (AC) register is a general purpose processing register.
o The instruction read from memory is placed in the Instruction register (IR).
o The Temporary Register (TR) is used for holding the temporary data during the
processing.
o The Input Registers (IR) holds the input characters given by the user.
o The Output Registers (OR) holds the output after processing the input data.
Shift Register
A group of flip flops which is used to store multiple bits of data and the data is moved from one
flip flop to another is known as Shift Register. The bits stored in registers shifted when the clock
pulse is applied within and inside or outside the registers. To form an n-bit shift register, we have
to connect n number of flip flops. So, the number of bits of the binary number is directly
proportional to the number of flip flops. The flip flops are connected in such a way that the first
flip flop's output becomes the input of the other flip flop.
A Shift Register can shift the bits either to the left or to the right. A Shift Register, which shifts
the bit to the left, is known as "Shift left register", and it shifts the bit to the right, known
as "Right left register".
The shift register is classified into the following types:
o Serial In Serial Out
o Serial In Parallel Out
o Parallel In Serial Out
o Parallel In Parallel Out
o Bi-directional Shift Register
o Universal Shift Register

Page 117 of 248


2.1.8. Computer Instructions
Computer instructions are a set of machine language instructions that a particular processor
understands and executes. A computer performs tasks on the basis of the instruction provided.
An instruction comprises of groups called fields. These fields include:
o The Operation code (Opcode) field which specifies the operation to be performed.
o The Address field which contains the location of the operand, i.e., register or memory
location.
o The Mode field which specifies how the operand will be located.

A basic computer has three instruction code formats which are:


1. Memory - reference instruction
2. Register - reference instruction
3. Input-Output instruction

Page 118 of 248

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy