COMPUTER ARCHITECTURE (CHAPTER 1n2)
COMPUTER ARCHITECTURE (CHAPTER 1n2)
1
- The micro-processor in the ad is a Pentium III, operating at 667MHz. Every computer system contains a clock
that keeps the system synchronized. The clock sends electrical pulses simultaneously to all main
components, ensuring that data and instructions will be where they’re supposed to be, when they’re supposed
to be there. The number of pulsations emitted each second by the clock is its frequency. Clock frequencies
are measured in cycles per second, or hertz, here it is millions of pulsation per second(MHz). The fact that this
microprocessor runs at 667MHz, however , doesn’ t necessarily mean that it can execute 667 million
instructions every second because each computer instruction requires a fixed number of cycles to
execute.
- The 133MHz refers to the speed of the system bus, which is a group of wires that moves data and instructions
to various places within the computer. The system in our advertisement also boasts a memory capacity of 64
megabytes (MB), or about 64 million characters. SDRAM, short for synchronous dynamic random access
memory. SDRAM is much faster than conventional (nonsynchronous) memory because it can synchronize
itself with a microprocessor’s bus.
- “32KB L1 cache, 256KB L2 cache” also describes a type of memory. It is to know that, no matter how fast a
bus is, it still takes “a while” to get data from memory to the processor . To provide even faster access to data,
many systems contain a special memory called cache. The system in our advertisement has two kinds of
cache. Level 1 cache (L1) is a small, fast memory cache that is built into the microprocessor chip and helps
speed up access to frequently used data. Level 2cache (L2) is a collection of fast, built-in memory chips
situated between the microprocessor and main memory. Notice that the cache in our system has a capacity of
kilobytes (KB), which is much smaller than main memory.
- 30GBis the storage capacity of a fixed (or hard) disk. A large disk isn’t very helpful if it is too slow for its
host system. The computer in our ad has a hard drive that rotates at 7200 RPM (revolutions per minute). To
the knowledgeable reader, this indicates. Rotational speed is only one of the determining factors in the overall
performance of a disk. The manner in which it connects to—or interfaces with—the rest of the system is also
important. The advertised system uses a disk interface called EIDE, or enhanced integrated drive electronics.
Most EIDE systems share the main system bus with the processor and memory.
- “2 USB ports, 1 serial port, 1 parallel port.”: three different ports, ports allow movement of data to and
from devices external to the computer. Most desktop computers come with two kinds of data ports: serial
ports and parallel ports. Serial ports transfer data by sending a series of electrical pulses across one or two
data lines. Parallel ports use at least eight data lines, which are energized simultaneously to transmit data. Our
advertised system also comes equipped with a special serial connection called a USB (universal serial bus)
port. USB is a popular external bus that supports Plug-and-Play as well as hot plugging (the ability to add
and remove devices while the computer is running).
- Some systems augment their main bus with dedicated I/O buses. Peripheral Component Interconnect (PCI) is
one such I/O bus that supports the connection of multiple peripheral devices. There are two PCI devices
mentioned in the ad. The PCI modem and the PCI sound card.
- “19" monitor, .24mm AG, 1280 X 1024 at 85Hz.”: This means that the image displayed on the monitor is
repainted 85 times a second. Resolution is determined by the dot pitch of the monitor, which is the distance
between a dot (or pixel) and the closest dot of the same colour. we have a 0.24 millimeter dot pitch supported
by an AG (aperture grill) display. This monitor is further supported by an AGP (accelerated graphics port)
graphics card.
2
2. Standards organizations
Most standards-setting organizations are ad-hoc trade associations or consortia made up of industry leaders.
Manufacturers know that by establishing common guidelines for a particular type of equipment, they can market their
products to a wider audience than if they came up with separate and perhaps Incompatible specifications. Some
standards organizations have formal charters and are recognized internationally as the definitive authority in certain
areas of electronics and computers.
- The Institute of Electrical and Electronic Engineers (IEEE) is an organization dedicated to the
advancement of the professions of electronic and computer engineering.
- The International Telecommunications Union (ITU) : the ITU concerns itself with the interoperability of
telecommunications systems, including telephone, telegraph, and data communication systems.
- The International Organization for Standardization (ISO) is the entity that coordinates worldwide
standards development, including the activities of the American National Stan-
- dards Institute (ANSI), British Standards Institution (BSI), the CEN (Comite Europeen de Normalisation), the
European committee for standardization among others.
3. Computer Evolution and Performance
The evolution of computers has been characterized by increasing processor speed, decreasing component size,
increasing memory size, increasing I/O capacity and speed. One factor responsible for great increase in processor
speed is the shrinking size of microprocessor components; this reduces, the distance between components and increase
speed. A critical issue in computer system design is balancing the performance of various elements, so that gains in
performance in one area are not handicapped by a lag in other areas.
a. The First Generation
ENIAC (Electronic Numerical Integrator and Computer) 1943-1955
Numbers were represented in decimal form and arithmetic was performed in the decimal system. it was
made using vacuum tubes. Vacuum tube was a fragile glass device that could control and amplify electronic
signals. Its memory consisted of 20 accumulators, each capable of holding a 10-digit decimal number. Its major
drawback was that it had to be programmed manually by setting switches and plugging and unplugging cables. Also
its weigh was around 30 tons; occupied 1500 square feet of floor space containing more than 18,000 vacuum tubes,
consumed 140 kilowatts of power and was being capable of 5000 additions per second.
3
Were unreliable since they were prone to frequent hardware failures
Commercial production was difficult
They were very costly and required constant maintenance
Continuous air conditioning was required
Programming was done in machine language although assembly language also started at the end of
this generation.
Example : ENIAC , EDVAC , UNIVAC 1
b. The Second Generation: Transistors
The first major change in the electronic computer came with the replacement of the vacuum tube by the
transistor. The transistor is smaller, cheaper, and dissipates less heat than a vacuum tube but can be used in the same
way as a vacuum tube to construct computers. Unlike the vacuum tube, which requires wires, metal plates, a glass
capsule, and a vacuum, the transistor is a solid-state device, made from silicon. It performs all the functions of a
vacuum tube i.e. switches circuit on and off at a very high speed. Transistors were developed at Bell Labs In
1947.
Other changes as well can be named; they are the introduction of more complex arithmetic and logic units and
control units, the use of high level programming languages, and the provision of system software with the computer.
Some of the names of second generation computers are IBM series, UNIVAC III, CDC 1400 series, Honeywell
etc.
4
The characteristics of 360 family are as follows: Similar or identical instruction sets, Similar or identical
operating system, Increasing speed, Increasing number of I/O ports, Increasing memory size, Increasing cost.
DEC PDP-8
In 1964, Digital Equipment Corporation (DEC) produced PDP-8, the first minicomputer. It was small enough
to sit on a lab bench and did not need air conditioned room. It used bus structure that is now virtually universal for
minicomputers and microcomputers.
Salient Features of Third Generation computers:
Used integrated circuits
Computers were smaller , faster and more reliable
Low power consumption and less emission of heat as compared to previous generations
d. fourth Generations (1975-2010)
The development of microprocessor chip that contains entire central processing unit (CPU) on a single
silicon chip led to the invention of fourth generation computers. The technology that was used in fourth generation
computers Large-Scale Integration (LSI) in which, it was possible to integrate 30,000 transistors on a single chip
and latter VLSI (Very Large Scale Integration) has come, in which millions of transistors can be assembled on single
chip.
Semiconductor Memory
The first application of integrated circuit technology to computers was construction of the processor (the control
unit and the arithmetic and logic unit) out of integrated circuit chips. But it was also found that this same technology
could be used to construct memories.
In 1970, Fairchild produced the first relatively capacious semiconductor memory. This chip could hold 256 bits of
memory. It took only 70 billionths of a second to read a bit. Following this, there has been a continuing and rapid
decline in memory cost accompanied by a corresponding increase in physical memory density. This has led the way to
smaller, faster machines.
Microprocessors
In 1971, Intel developed its 4004 which was the first chip to contain all of the components of a CPU on a single
chip: the microprocessor was born. 4004 can add two 4-bit numbers these are its followers:
In 1972 the introduction of Intel 8008 this was the first 8-bit microprocessor and was almost twice as complex as
the 4004. The 4004 and the 8008 had been designed for specific applications
In 1974, Intel 8080 which was the first general-purpose microprocessor is introduced. Like the 8008, the 8080 is
an 8-bit microprocessor. However, is faster, has a richer instruction set, and has a large addressing capability.
At the end of 1970s, general-purpose 16-bit microprocessors appeared. One of these was the 8086.
5
Computers were Very reliable ,powerful and small in size
Negligible power consumption and heat generation and Very less production cost
e. Fifth Generation Computers
Fifth Generation computers are still under development, they will have thinking power and capability to make
decisions like human beings, and may prove better than man in certain aspects. They will be more useful in the field of
knowledge processing rather than in data processing. The concept of Artificial Intelligence (AI) is being used in
these computers and also other concepts like swarm intelligence or distributed intelligence which has proven
consistent result in robot manufacturing. These computers will have Knowledge Information Processing System
(KIPS) rather than the present Data/Logic Information Processing System. Some applications like voice
recognition, visual recognition are a step in this very direction.
Salient features of fifth generation computers:
Parallel Processing
Superconductivity
Artificial Intelligence and swarm intelligence
4. Von Neumann Architecture
General structure of the IAS computer consists of:
A main memory, which stores both data and instructions.
The central processing unit : Which holds (1) An arithmetic and logic unit (ALU) capable of operating on binary
data. (2) A control unit, which interprets the instructions in memory and causes them to be executed and (3)
Registers.
Input and output (I/O) equipment
6
The Modified von Neumann Architecture, Adding a System Bus(Bus Architechture)
The Modified von Neumann Architecture, Adding a System Bus and controller
6. Computer measurement units
a. Clock frequencies
They are measured in cycles per second, or Hertz. Processor speeds are measured in MHz or GHz, 1MHz =
1,000,000Hz
b. unit in storage
Bytes are also used to represent characters in a text. Different types of coding schemes are used to represent the character set
and numbers. The most commonly used coding scheme is the American Standard Code for Information Interchange (ASCII).
The following table shows the representation of various memory sizes.
Read as 2 power10.
Megabyte: 1 megabyte = 220 bytes =1,048,576 bytes
Gigabyte: 1 gigabyte = 230 bytes = 1,073,741,824 bytes.
c. Measures of time and space
Millisecond = 1 thousandth (10-3) of a second (Hard disk drive access times
are often 10 to 20 milliseconds.)
Nanosecond = 1 billionth (10-9) of a second (Main memory access times are
often 50 to 70 nanoseconds.)
Micron (micrometer) = 1 millionth (10-6) of a meter (Circuits on computer chips are measured in microns.)
Exercise:
1) Describe each feature presented
in the following computer
7
CHAPTER 2
Data Representation (Integers, Floating-point Numbers, and Characters)
Learning outcomes
After completing this chapter, and the Essential reading and activities, you should be able to:
explain how textual and numeric information can be represented in binary form
o perform basic calculations within the binary system
Introduction
The previous chapter has given you an overview of how a computer operates. It has shown that, in
order to operate, the computer needs to store and process data. This chapter is concerned with the way
data needs to be represented so it can be stored in a computer’s memory and processed as part of
computer operations. The representation of data can be qualitative (based quality, characteristics, eg:
name, NIC, address, etc) or quantitative (proportional to a value, eg number of student, number of
marks, etc). Either quantitative or qualitative, all data in a computer are represented using the binary
system.
0. Data and information
Computer is an electronic device that processes the input according to the set of instructions
provided to it and gives the desired output at a very fast rate.
Data: It is the term used for raw facts and figures while information is Data represented in useful and
meaningful form is information. In simple words we can say that data is the raw material that is
processed to give meaningful, ordered or structured information. There are different types of data,
namely, text, number, images, sound or video.
Representing text
A common way to represent text is to agree on a unique code for every symbol (e.g. for every letter,
punctuation mark or number) that needs to be presented. Each code consists of a fixed-length sequence
of bits (but obviously the sequence is different for each code). A word can then be ‘written’ by
determining the code for each letter and stringing them together. Characters includes letters(A-Z,a-z),
digit, and other special symbols like &,#,{,[,|,\,^,@,],}. The standard used to represent characters is:
Binary Coded Decimal (BCD) is a method of using binary digits to represent the decimal
digits 0–9. A decimal digit is represented by four binary digits. E.g. BCD(53)= 01010011
Decimal Code 0 1 2 3 4 5 6 7 8 9
BCD Digit 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
ASCII(American standard code for Information Interchange) it is limited to English symbol
EBCDIC(Extended binary coded decimal interchange code), it is used by large IBM computer
Unicode also known as UTF(Unicode text Format), it is the widely used because it is
compatible with many languages like French, Spanish, Chinese,Swahili, Haoussa, Arab etc
Representing images
Images are also encoded using bit patterns. Generally an image is divided into many small picture
elements (pixels), and the appearance of each pixel is then encoded in binary form. The collection of
these encoded pixels is known as the bitmap of the image. A colour image usually uses three bytes to
represent a single pixel. For example, computers frequently use a combination of red, green and blue
light to represent a wide spectrum of colour (the RGB colour model).
Representing sound
In order to store sound on your computer, the analogue sound signal needs to be converted into a
digital format. Typically the amplitude of the sound wave is checked and recorded at regular time
intervals. These values can then be stored in binary form and used to re-construct the initial wave at a
later stage.
A numbering system is a way of representing numbers. The most commonly used numbering system
is the decimal system. A bit (binary digit) is the smallest data stored in the computer memory. Its
values are 0 and 1. A collection of 8 bits is called a byte. With 8 bits or a byte, we can represent 256
values ranging from 0 to 255. The largest number with 8 binary digits, 28-1=255, thus the largest
number with n is 2n-1
1. Number Systems
Human beings use decimal (base 10) number systems for counting and measurements (probably because
we have 10 fingers and two big toes). Computers use binary (base 2) number system, as they are made
from binary digital components (known as transistors) operating in two states - on and off. In computing,
we also use hexadecimal (base 16) or octal (base 8) number systems, as a compact form for representing
binary numbers.
1.1 Decimal (Base 10) Number System
Decimal number system has ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, called digits. It uses positional
notation. That is, the least-significant digit (right-most digit) is of the order of 10^0 (units or ones), the
second right-most digit is of the order of 10^1 (tens), the third right-most digit is of the order
of 10^2 (hundreds), and so on, where ^ denotes exponent. For example,
10110B = 10000B + 0000B + 100B + 10B + 0B = 1×2^4 + 0×2^3 + 1×2^2 + 1×2^1 + 0×2^0
We shall denote a binary number with a suffix B. Some programming languages denote binary numbers
with prefix 0b or 0B (e.g., 0b1001000), or prefix b with the bits quoted (e.g., b'10001111').
A binary digit is called a bit. Eight bits is called a byte (why 8-bit unit? Probably because 8=23).
1.3 Hexadecimal (Base 16) Number System
Hexadecimal number system uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F, called hex
digits. It is a positional notation, for example,
We shall denote a hexadecimal number (in short, hex) with a suffix H. Some programming languages
denote hex numbers with prefix 0x or 0X (e.g., 0x1A3C5F), or prefix x with hex digits quoted
(e.g., x'C3A4D98B').
Each hexadecimal digit is also called a hex digit. Most programming languages accept lowercase 'a' to 'f' as
well as uppercase 'A' to 'F'.
Computers uses binary system in their internal operations, as they are built from binary digital electronic
components with 2 states - on and off. However, writing or reading a long sequence of binary bits is
cumbersome and error-prone (try to read this binary string: 1011 0011 0100 0011 0001 1101 0001 1000B ,
which is the same as hexadecimal B343 1D18H). Hexadecimal system is used as a compact form
or shorthand for binary bits. Each hex digit is equivalent to 4 binary bits, i.e., shorthand for 4 bits, as
follows:
He x a de c i ma l B i na r y D e c i ma l
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15
It is important to note that hexadecimal number provides a compact form or shorthand for representing
binary bits.
1.6 Conversion from Base r to Decimal (Base 10)
Given a n-digit base r number: dn-1dn-2dn-3...d2d1d0 (base r), the decimal equivalent is given by:
dn-1×rn-1 + dn-2×rn-2 + ... + d1×r1 + d0×r0
For examples,
The above procedure is actually applicable to conversion between any 2 base systems. For example,
8 0 (2^8)-1 (=255)
16 0 (2^16)-1 (=65,535)
Example 3: Addition of Two Negative Integers: Suppose that n=8, -65D - 5D = (-65D) + (-
5D) = -70D
Because of the fixed precision (i.e., fixed number of bits), an n-bit 2's complement signed integer has a
certain range. For example, for n=8, the range of 2's complement signed integers is -128 to +127. During
addition (and subtraction), it is important to check whether the result exceeds this range, in other words,
whether overflow or underflow has occurred.
Example 4: Overflow: Suppose that n=8, 127D + 2D = 129D (overflow - beyond the range)
127D → 0111 1111B
2D → 0000 0010B(+
1000 0001B → -127D (wrong)
Example 5: Underflow: Suppose that n=8, -125D - 5D = -130D (underflow - below the range)
-125D → 1000 0011B
-5D → 1111 1011B(+
0111 1110B → +126D (wrong)
The following diagram explains how the 2's complement works. By re-arranging the number line, values
from -128 to +127 are represented contiguously by ignoring the carry bit.
Normalized Form
Let's illustrate with an example, suppose that the 32-bit pattern is 1 1000 0001 011 0000 0000 0000
0000 0000, with:
S=1
E = 1000 0001
F = 011 0000 0000 0000 0000 0000
In the normalized form, the actual fraction is normalized with an implicit leading 1 in the form of 1.F. In
this example, the actual fraction is 1.011 0000 0000 0000 0000 0000 = 1 + 1×2^-2 + 1×2^-3 = 1.375D.
The sign bit represents the sign of the number, with S=0 for positive and S=1 for negative number. In this
example with S=1, this is a negative number, i.e., -1.375D.
In normalized form, the actual exponent is E-127 (so-called excess-127 or bias-127). This is because we
need to represent both positive and negative exponent. With an 8-bit E, ranging from 0 to 255, the excess-
127 scheme could provide actual exponent of -127 to 128. In this example, E-127=129-127=2D.
Hence, the number represented is -1.375×2^2=-5.5D.
De-Normalized Form
Normalized form has a serious problem, with an implicit leading 1 for the fraction, it cannot represent the
number zero! Convince yourself on this!
De-normalized form was devised to represent zero and other numbers.
For E=0, the numbers are in the de-normalized form. An implicit leading 0 (instead of 1) is used for the
fraction; and the actual exponent is always -126. Hence, the number zero can be represented
with E=0 and F=0 (because 0.0×2^-126=0).
We can also represent very small positive and negative numbers in de-normalized form with E=0. For
example, if S=1, E=0, and F=011 0000 0000 0000 0000 0000. The actual fraction is 0.011=1×2^-2+1×2^-
3=0.375D. Since S=1, it is a negative number. With E=0, the actual exponent is -126. Hence the number is -
0.375×2^-126 = -4.4×10^-39, which is an extremely small negative number (close to zero).
Summary
In summary, the value (N) is calculated as follows:
For 1 ≤ E ≤ 254, N = (-1)^S × 1.F × 2^(E-127). These numbers are in the so-called normalized form.
The sign-bit represents the sign of the number. Fractional part (1.F) are normalized with an implicit
leading 1. The exponent is bias (or in excess) of 127, so as to represent both positive and negative
exponent. The range of exponent is -126 to +127.
For E = 0, N = (-1)^S × 0.F × 2^(-126). These numbers are in the so-called denormalized form. The
exponent of 2^-126 evaluates to a very small number. Denormalized form is needed to represent zero
(with F=0 and E=0). It can also represents very small positive and negative number close to zero.
For E = 255, it represents special values, such as ±INF (positive and negative infinity) and NaN (not a
number). This is beyond the scope of this article.
Example 1: Suppose that IEEE-754 32-bit floating-point representation pattern is 0 10000000 110
0000 0000 0000 0000 0000.
Sign bit S = 0 ⇒ positive number
E = 1000 0000B = 128D (in normalized form)
Fraction is 1.11B (with an implicit leading 1) = 1 + 1×2^-1 + 1×2^-2 = 1.75D
The number is +1.75 × 2^(128-127) = +3.5D
Example 2: Suppose that IEEE-754 32-bit floating-point representation pattern is 1 01111110 100
0000 0000 0000 0000 0000.
Sign bit S = 1 ⇒ negative number
E = 0111 1110B = 126D (in normalized form)
Fraction is 1.1B (with an implicit leading 1) = 1 + 2^-1 = 1.5D
The number is -1.5 × 2^(126-127) = -0.75D
Example 3: Suppose that IEEE-754 32-bit floating-point representation pattern is 1 01111110 000
0000 0000 0000 0000 0001.
Sign bit S = 1 ⇒ negative number
E = 0111 1110B = 126D (in normalized form)
Fraction is 1.000 0000 0000 0000 0000 0001B (with an implicit leading 1) = 1 + 2^-23
The number is -(1 + 2^-23) × 2^(126-127) = -0.500000059604644775390625 (may not be exact in decimal!)
Example 4 (De-Normalized Form): Suppose that IEEE-754 32-bit floating-point representation
pattern is 1 00000000 000 0000 0000 0000 0000 0001.
System.out.println(Float.intBitsToFloat(0x7fffff));
System.out.println(Double.longBitsToDouble(0x1fffffffffffffL));
Special Values
Zero: Zero cannot be represented in the normalized form, and must be represented in denormalized form
with E=0 and F=0. There are two representations for zero: +0 with S=0 and -0 with S=1.
Infinity: The value of +infinity (e.g., 1/0) and -infinity (e.g., -1/0) are represented with an exponent of all
1's (E = 255 for single-precision and E = 2047 for double-precision), F=0, and S=0 (for +INF) and S=1 (for -
INF).
Not a Number (NaN): NaN denotes a value that cannot be represented as real number (e.g. 0/0). NaN is
represented with Exponent of all 1's (E = 255 for single-precision and E = 2047 for double-precision) and
any non-zero fraction.
5. Character Encoding
In computer memory, character are "encoded" (or "represented") using a chosen "character encoding
schemes" (aka "character set", "charset", "character map", or "code page").
For example, in ASCII (as well as Latin1, Unicode, and many other character sets):
code numbers 65D (41H) to 90D (5AH) represents 'A' to 'Z', respectively.
code numbers 97D (61H) to 122D (7AH) represents 'a' to 'z', respectively.
code numbers 48D (30H) to 57D (39H) represents '0' to '9', respectively.
It is important to note that the representation scheme must be known before a binary pattern can be
interpreted. E.g., the 8-bit pattern "0100 0010B" could represent anything under the sun known only to the
person encoded it.
The most commonly-used character encoding schemes are: 7-bit ASCII (ISO/IEC 646) and 8-bit Latin-x
(ISO/IEC 8859-x) for western european characters, and Unicode (ISO/IEC 10646) for internationalization
(i18n).
A 7-bit encoding scheme (such as ASCII) can represent 128 characters and symbols. An 8-bit character
encoding scheme (such as Latin-x) can represent 256 characters and symbols; whereas a 16-bit encoding
scheme (such as Unicode UCS-2) can represents 65,536 characters and symbols.