Topics included:
===============================================
The different types of computers
The basic structure of a computer and its operation
Machine instructions and their execution
Integer, floating-point, and character representations
Addition and subtraction of binary numbers
Basic performance issues in computer systems
A brief history of computer development
2. Course Objectives
After successfully completing this course, you will be able to:
• Understand the design of computer system and its components.
• Understand different CPU design, ISA, addressing, and
microprogramming.
• Understand different memory management and I/O strategies and
techniques.
3. Course Outline
• Basic Structure of Computers
• Instruction Set Architecture
• Basic I/O
• I/O Organization
• Basic Processing Unit
• Computer Arithmetic
• The Memory System
4. Text Books to Follow
• Computer Organization and Embedded Systems by C Hamacher, 6th
Edition 2012.
• Computer Organization and Architecture: Designing for
Performance, by William Stallings 8th Edition, Prentice Hall.
• Structured Computer Organization by Andrew S Tanenbaum 5th
Edition.
6. Lecture Outline
• The different types of computers
• The basic structure of a computer and its operation
• Machine instructions and their execution
• Integer, floating-point, and character representations
• Addition and subtraction of binary numbers
• Basic performance issues in computer systems
• A brief history of computer development
7. Computer Types
• Since their introduction in the 1940s, digital computers have evolved
into different types
• Sze, cost, computational power, and intended use.
• Modern computers can be divided into below categories
• Embedded Computers
• Personal Computers
• Servers and Enterprise Systems
• Supercomputers and Grid Computers
• Emerging trend in access to computing facilities – cloud computing.
8. Functional Units
• Five functional parts
• Input, memory, ALU, output, and
CU.
• Interconnection network
• Exchange information and
coordinate their actions.
9. Functional Units
• Information handled by computer
• Instruction or data.
• Instructions, are explicit commands
• Transmission of information
• Specify the AL operations.
• Program, is a list of instructions which
performs a task.
• Data are numbers and characters
used as operand by the instructions.
10. Functional Units
• Instructions must be encoded in a
suitable format.
• Most recent H/W employs digital
circuits that have only two states.
• Everything is encoded as string of
binary digits called bits.
• Having one of two values, 0 or 1.
11. Functional Units
Input Unit
• Computers accept coded information though input units.
• Keyboard, touchpad, mouse, joystick, and trackball.
• Digital communication facilities, such as internet, can also provide
input to a computer.
12. Functional Units
Memory Unit
• Primary memory, also called main memory, is a fast memory that
operates at electronic speeds.
• Programs are stored while being executed.
• Consist of large number of semiconductor storage cells, each capable of
storing one bit of information.
• Handled in groups of fixed size called words.
• Number of bits in each word is referred to as word length, typically 16, 32, or 64 bits.
• For access, each word in memory has a distinct address.
13. Functional Units
Memory Unit
• Instructions and data can be written or read under the control of processor.
• A memory in which any memory location can be accessed in a short of fixed
amount of time after specifying its address is called RAM.
• Memory access time, time required to access one word.
• From few to 100ns – Independent of the location of word being accessed.
14. Functional Units
Cache Memory
• Smaller, faster RAM unit, called cache.
• Used to hold sections of a program that are currently being executed, along
with any associated data.
• Tightly coupled with the processor and is usually contained on the
same integrated-circuit chip.
• Suppose, execution of a number of execution in a program loop.
• Cache hit and Cache miss operations.
15. Functional Units
Secondary Storage
• Although primary memory is essential, expensive, and volatile.
• Thus additional, less expensive, permanent secondary storage is used for
large amount of data storage.
• Access times are longer than as compare to primary memory.
• Wide selection of devices such as
• Magnetic disks, optical disks (DVD and CD), and flash memory devices.
16. Functional Units
Arithmetic and Logic Unit
• Most computer operations are executed in ALU of the processor.
• addition, subtraction, multiplication, division, or comparison of numbers.
• When operands are brought into the processor, they are stored in
high-speed storage elements called registers.
• Access time is shorter as compare to other storage systems.
17. Functional Units
Output Unit
• Counterpart of the input unit.
• Sends processed results to the outside world such as printer and graphic
displays.
• Often, looks sometimes comes with dual functionality, I/O units.
18. Functional Units
Control Unit
• The coordination of all the above units are handled through CU.
• It is like a nerve center that sends control signals to other units and senses
their states.
• Processing cycle is all managed by control unit.
19. Basic Operational Concepts
• We have learned,
• Activity is governed through instructions.
• For performing a task, program is loaded into memory.
• Individual instructions are brought to the processor for processing.
• A typical instruction might be
MOV R2, LOC
ADD R4, R3
MOV LOC, R4
20. Basic Operational Concepts
• IR holds the instruction that is currently
being executed.
• PC contains the memory address of the
next instruction to be fetched and
executed.
• R0 through Rn-1 are general purpose
registers.
• The processor-memory interface sends
read and write control signals.
• Use of interrupt signal and interrupt-
service routine.
21. Number Representation and Arithmetic
Operations
• The most natural way to represent a number in a computer system is
by a string of bits, called a binary number.
• We will have discussion on binary representation for Integers as its
arithmetic operations and then floating-point numbers.
22. Integers
• A bit is the most basic unit of information in a computer.
• It is a state of “on” or “off” in a digital circuit.
• Or “high” or “low” voltage instead of “on” or “off.”
• A byte is a group of eight bits.
• A byte is the smallest possible addressable unit of computer storage.
• A word is a contiguous group of bytes
• Word sizes of 16, 32, or 64 bits are most common.
• Usually a word represents a number or instruction.
23. Integers
• Start with the least significant bit (rightmost bit)
• Add each pair of bits
• Include the carry in the addition, if present
0 0 0 0 0 1 1 1
0 0 0 0 0 1 0 0
+
0 0 0 0 1 0 1 1
1
(4)
(7)
(11)
carry:
01234bit position: 567
24. Integers
• There are three ways in which signed binary numbers may be
expressed:
• Signed magnitude,
• One’s complement and
• Two’s complement.
• In an 8-bit word, signed magnitude representation places the
absolute value of the number in the 7 bits to the right of the sign bit.
26. Integers
• Binary addition is as easy as it gets. You need to know only four
rules:
0 + 0 = 0 0 + 1 = 1
1 + 0 = 1 1 + 1 = 10
• The simplicity of this system makes it possible for digital circuits to
carry out arithmetic operations.
• We will describe these circuits in Chapter 3.
26
Let’s see how the addition rules work with signed
magnitude numbers . . .
27. Integers
• Example:
• Using signed magnitude binary arithmetic,
find the sum of 75 and 46.
• First, convert 75 and 46 to binary, and arrange
as a sum, but separate the (positive) sign bits
from the magnitude bits.
27
In this example, we were careful careful to pick two values
whose sum would fit into seven bits. If that is not the case, we
have a problem.
28. Integers
• Example:
• Using signed magnitude binary
arithmetic, find the sum of 107 and
46.
• We see that the carry from the seventh
bit overflows and is discarded, giving
us the erroneous result:
107 + 46 = 25.
29. Integers
• Signed magnitude representation is easy for people to understand,
but it requires complicated computer hardware.
• Another disadvantage of signed magnitude is that it allows two
different representations for zero: positive zero and negative zero.
• For these reasons (among others) computers systems employ
complement systems for numeric value representation.
29
30. Integers
• In complement systems, negative values are represented by some
difference between a number and its base.
• In diminished radix complement systems, a negative value is given
by the difference between the absolute value of a number and one
less than its base.
• In the binary system, this gives us one’s complement. It amounts to
little more than flipping the bits of a binary number.
30
31. Integers
• For example, in 8-bit one’s complement;
• + 3 is: 00000011
• - 3 is: 11111100
• In one’s complement, as with signed magnitude, negative values are
indicated by a 1 in the high order bit.
• Complement systems are useful because they eliminate the need for
special circuitry for subtraction. The difference of two values is found
by adding the minuend to the complement of the subtrahend.
32. Integers
• With one’s complement addition, the carry bit
is “carried around” and added to the sum.
• Example: Using one’s complement binary
arithmetic, find the sum of 48 and - 19
We note that 19 in one’s complement is 00010011,
so -19 in one’s complement is: 11101100.
33. Integers
• Although the “end carry around” adds some complexity, one’s
complement is simpler to implement than signed magnitude.
• But it still has the disadvantage of having two different
representations for zero: positive zero and negative zero.
• Two’s complement solves this problem.
• Two’s complement is the radix complement of the binary numbering
system.
34. Integers
• To express a value in two’s complement:
• If the number is positive, just convert it to binary and you’re done.
• If the number is negative, find the one’s complement of the number
and then add 1.
• Example:
• In 8-bit one’s complement, positive 3 is: 0 0 0 0 0 0 1 1
• Negative 3 in one’s complement is: 1 1 1 1 1 1 0 0
• Adding 1 gives us -3 in two’s complement form: 11111101.
35. Integers
starting value 00100100 = +36
step1: reverse the bits (1's complement) 11011011
step 2: add 1 to the value from step 1 + 1
sum = 2's complement representation 11011100 = -36
Sum of an integer and its 2's complement must be zero:
00100100 + 11011100 = 00000000 (8-bit sum) Ignore Carry
The easiest way to obtain the 2's complement of a binary number is by
starting at the LSB, leaving all the 0s unchanged, look for the first
occurrence of a 1. Leave this 1 unchanged and complement all the bits
after it.
36. Integers
• With two’s complement arithmetic, all we do is add our two binary
numbers. Just discard any carries emitting from the high order bit.
We note that 19 in one’s complement is: 00010011,
so -19 in one’s complement is: 11101100,
and -19 in two’s complement is: 11101101.
– Example: Using one’s
complement binary
arithmetic, find the sum of
48 and - 19.
37. Integers
• When we use any finite number of bits to represent a number, we
always run the risk of the result of our calculations becoming too
large to be stored in the computer.
• While we can’t always prevent overflow, we can always detect
overflow.
• In complement arithmetic, an overflow condition is easy to detect.
38. Integers
• Example:
• Using two’s complement binary arithmetic,
find the sum of 107 and 46.
• We see that the nonzero carry from the seventh
bit overflows into the sign bit, giving us the
erroneous result: 107 + 46 = -103.
Rule for detecting two’s complement overflow: When the
“carry in” and the “carry out” of the sign bit differ, overflow has
occurred.
39. Integers
• When subtracting A – B, convert B to its 2's complement
• Add A to (–B)
0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0
0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 (2's complement)
0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 (same result)
– +
• Carry is ignored, because
• Negative number is sign-extended with 1's
• You can imagine infinite 1's to the left of a negative number
• Adding the carry to the extended 1's produces extended zeros
40. Character Representation
• ASCII is the most common encoding schema for characters.
• Alphanumeric characters, operators, punctuation symbols, and
control characters are represented by 7-bit codes.
• A byte is used for the representation and storage.
• The sequential increasing order of codes (alphabets and numeric)
when changed to unsigned binary describes sorting operation.
• The low-order four bits of the ASCII describes BCD code.
• Code for 0 to 9 decimal digits.
41. Performance
• Measure of performance is how quickly it executes program.
• Design of its instruction set, hardware and software, including OS and the
technology in which the hardware is implemented.
• By technology, processor and system organization – This section.
42. Performance
• Technology
• VLSI is a critical factor of the speed of execution of machine instruction.
• Switching between 0 and 1 in logic circuits is determined by size of transistors
used.
• Smaller transistors switch faster
• Instructions can be executed faster and more transistors can be placed,
leading to more logic functionality and more memory storage capacity.
• Advances in fabrication technology over several decades have reduced
transistor sizes dramatically.
43. Performance
• Parallelism
• Performing number of operations in parallel.
• Instruction-Level Parallelism – Pipelining.
• complete all steps of the current instruction before starting the steps of the next
instruction – execution of a sequence of instructions.
• overlapping the execution of the steps of successive instruction to reduced total
execution time.
• Multicore Processors
• Multiple processing units (core) on a single chip.
• Dual-core, quad-core, and octo-core processors for chips having 2, 4, and 8 cores
respectively.
44. Performance
• Parallelism
• Multiprocessors
• Many processors, each possibly containing multiple cores.
• Shared-Memory multiprocessor.
• In contrast, It is also possible to use an interconnected group of complete computers to
achieve high total computational power.
• Message-Passing multicomputer.
45. Summery
• The different types of computers
• The basic structure of a computer and its operation
• Machine instructions and their execution
• Integer, floating-point, and character representations
• Addition and subtraction of binary numbers
• Basic performance issues in computer systems
• A brief history of computer development