








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A handout for a university course, ecs 50, on computer organization. It covers the basics of computers, including the history of computers, desktop computers, general purpose microprocessors and microcontrollers, and number systems. The document also includes information on course objectives, lecture format, homework assignments, and exam dates.
Typology: Study notes
1 / 14
This page cannot be seen from the preview
Don't miss anything!









Shoukat Ali
Introduction and Review Introduction and Review
Handout 1
22
Name: Dr. Shoukat Ali (pronounced Shaw Cut Uh Li)
Email: [email protected]
Phone: 916-934-
Office:
Office Hours: 7:30—8:30 PM Thursday
33
explain why this course is very important
Some history of computers
talk about some administrative matters
44
Introduction to Processor Architecture^
Introduction to instruction sets, addressing modes and registersets, and their variation from one machine to another.
The Role of System Software in Producing an Abstract Machine^
Distinction between the roles of hardware and software. Theuse of compilers and operating systems in providingabstractions and machine independence to the programmer
Machine Capability and Speed^
Transportability/nontransportability of programs on differentmachines, and under different operating systems andcompilers.
55
understand terms computer, microprocessor, and microcontroller
understand the organization of a simple microprocessor
understand the use of an instruction set
66
computer: a device that stores and retrieves data and sequentiallyexecutes a stored program
what is the distinction between program and data?
77
1960s – era of large mainframes, machines costing millions ofdollars, stored in computer rooms, and run by multiple operators^
typical applications: business data processing and large-scalescientific computing
1970s – era of minicomputers, smaller-sized machines mostlyused by multiple users in a “time share” fashion^
each user would access the machine through a dumb terminal
88
1980s – era of desktop computers based on microprocessors^
personal computers and workstations
individually owned, no time-sharing
led to servers, computers that provided larger-scale servicessuch as reliable, longterm file storage (file servers) and morecomputing power (compute servers)
1980s – also saw microcontrollers aka embedded computers^
computers lodged in other devices where the presence of thecomputers is not immediately obvious
these computers interface with real world and turn somedevices on and off and monitor conditions
1990s – era of the Internet and the World Wide Web
1313
Microcontrollers Are Embedded In These Home Items Microcontrollers Are Embedded In These Home Items
1414
Consumer electronics
Industrial Controls^
Labeling machines
Coin Acceptors
Aerospace^
Flight control systems
Navigation systems
1515
1616
every one of you can do well on this course
do not jeopardize your success by:^
skipping classes
failing to do the homework
procrastinating
expecting to “learn by osmosis”
being dishonest in any way
Slide adapted from Dr. David Meyer.
1717
relying solely on lectures on how to solve course problems
only reading about how to solve course problems
watching someone else solve the course problem, or reading theirsolution
you will forget most of what you hear, but will remember most ofwhat you put into practice
Slide adapted from Dr. David Meyer.
1818
1919
Principles of Computer Systems^
Gerald M. Karam and John C. Bryant
Prentice Hall, 1992.
2020
5 minute review of the previous lecture
35 minute lecture
5 minute break (water, stretch) – not always given
35 minute lecture
I will come to class early and stay after to answer questions
in most lectures, slides will have to be filled in by students in class
2525
Do not take someone else's work and present it as your own.
I encourage you to study in groups. Discussions on HW arewelcome. However, you must not take someone else’s work andpresent it as your own.
If in doubt, please check with me.
Any instances of cheating will be reported to universityadministrative officials for further action and possible suspensionor expulsion from the University
2626
Will take surveys from time to time
Your comments are welcome throughout the semester
2727
2828
2929
signal^
a voltage or a current that conveys information
so how many pieces of information are in a signal?^
depends on how you interpret the signal!!
analog signal^
signal changes in a range, and every value of the signalrepresents a different piece of information
binary digital signal^
signal still changes in a range, but we interpret only two piecesof information
0 or 1, false or true, no or yes,negated or asserted, bad or good
3030
the way a signal is interpreted can be different^
the digital way of interpreting a signal
the analog way of interpreting a signal
5 volts 0 volts
any voltage in the red rangeis interpreted as logic 1any voltage in the gray rangecannot be interpreted; invalidany voltage in the green rangeis interpreted as logic 0
3131
Information is represented using “bit patterns” in computers^
Why?
1 0 1 1
3232
integers^
real numbers^
questions:^
how do we represent integers and real numbers in a binarydigital system?
how should we implement arithmetic operations like add,subtract, multiply, and divide?
3737
analogous to the method for converting from decimal to binary^
repeatedly divide by N until quotient is zero
save all remainders
the first remainder is the least significant digit, and the lastremainder is the most significant digit
3838
Say we want to know how to represent 257 in base 16 using 4digits in base 16^
We want to know d
d 3
d 2
d 1
0
such that
d
3
2
1
0
From previous slide we know that d
d 3
d 2
d 1
0
is 0101
In general representing X in base N using y digits requires solvingd
y-
y-
y-
y-
2
2
1
0
each digit is less than N and larger than 0
LHS divided by N = (d
y-
y-
y-
y-
1
) + d
the quotient is d
y-
y-
y-
y-
1
the remainder is d
0
Notation: remainder of X divided by N = X mod N
Notation: quotient of X divided by N = X/N
3939
How do we determine d
(d
y-
y-
y-
y-
*N + d 2
LHS divided by N results in:^
Quotient of d
y-
y-
y-
y-
2
Remainder is d
1
4040
three methods exist^
signed-magnitude representation
radix complement representation
method 1 is most intuitive but least easy to use foraddition/subtraction^
will see why
the so-called “complement representations” are a better suited foraddition/subtraction^
will see why
4141
use a symbol to specify whether the magnitude is positive ornegative
for decimal numbers, positive/negative are indicated by + and –signs^
for binary numbers, positive/negative are indicated by using anextra bit position (0 for positive, 1 for negative)^
2
10
2
10
2
10
2
10
2
10
2
10
4242
how to add two numbers represented in SM?^
examine the sign of the addends
if both have the same sign, just add and use the sign of theaddends as the sign of the sum
if the addends have different signs,
^
determine which number has the larger magnitude ^
subtract the smaller magnitude number from the larger magnitudenumber ^
append the sign of the larger magnitude number with thedifference
so what? what is the problem with the above?^
There are two strings that represent 0
“complement representation” of negative numbers does nothave this problem!!
4343
in SM, a positive number and its negation differ only in sign (or asign bit for binary numbers)
in CN, the negative of a number is equal to the so-called“complement” of the number
radix complement of an n digit number D is given bynr^
10’s complement of 49 is 10
2
i.e., negative of 49 in 10’s complement is 51
4444
for binary numbers, radix complement is called “two’scomplement”^
the complement equals r
n
n^
alternative convenient way of finding 2’s complement^
write the number in the binary form
flip all bits
add one
^
drop any carry out of MSB
8-bit examples
100000000
2
11111111
2
0
10
= 00000000
2
11111111
2
11101111
2
11111110
2
11101110
2
1
10
= 00000001
2
17
10
= 00010001
2
flip bits
add 1
fact: a –ve number will always have a 1 in the MSB
4949
how do we encode a negative number, say -7, using 4-bit 2’scomplement binary?^
many methods exist
one neat trick
encode the magnitude in simple binary
7 = 0111
flip the bits
1000
add 1
1000 + 0001 = 1001
drop any carry out of leftmost bit
check to make sure you got it right
1001 = 1x (-2)
(^3)
2
1
0
= -8 + 0 + 0 + 1 = -
5050
Computers do all their processing in fixed size cells called“registers”^
Intel 8086, 80186, 80286 have 16 bit wide registers
Intel 80386, i486, Pentium, Core have 32 bit wide registers
Intel Itanium has 64 bit wide registers
Unless the result of an addition is too large to be accommodatedin the register where the result is deposited, the addition is valid
How do we know if it is invalid?
5151
0
0
0000 0000
1
1
0000 0001
2
2
0000 0010
….
….
…………
126
126
0111 1110
127
127
0111 1111
128
1000 0000
129
1000 0001
…
…………
254
1111 1110
255
1111 1111
Value in 2’scomplement
Value inunsigned binary
Bit string
5252
Assume an 8-bit long string
If the sum is more than 255, we say that the addition hasoverflowed
Can be detected in the hardware by checking if there is a carry outof the most significant bit (MSB)
Usually computers store the value of the carry that comes out ofthe MSB in a special 1-bit cell called the “carry flag”^
After an unsigned addition, the carry flag is checked
If it is 1, the addition has overflowed
= 129
= 1000 0001
2
0000 0010
127
0111 1111
= 127
= 0111 1111
128
1000 0000
255
1111 1111
= 255
= 1111 1111
1000 0000
127
0111 1111
5353
Assume an 8-bit long string
If the sum is more than 127 or smaller than -128, the addition hasoverflowed
Can only occur if the sign bits of the numbers being added are thesame
Can be detected in the hardware by checking if the sign bit of theresult is not the same as that of numbers being added
In computers, there is a special 1-bit cell called the “overflow flag”that is set by hardware to 1 for all cases like
= -
= 1000 0001
2
0000 0010
127
0111 1111
= 127
= 0111 1111
1111 1111
= 0
= 0000 0000
127
0111 1111
5454
hexadecimal numbers can use 16 digits^
what is the value of B2FD if it is in base 16?^
B2FD = (Bx
3
) + (2x
2 ) + (Fx
1 ) + (Dx
= (11x
3 ) + (2x
2
) + (15x
(^1) ) + (13x
5555
Hexadecimal is a more compact representation of binary
Each hex digit represents 16 decimal values
Four binary digits represent 16 decimal values
Therefore, one hex digit can replace four binary digits
Example:^
binary
b
a
c
a
hex
the C language assumes that any number prefixed by “0x” ishexadecimal
e.g., 0x3b9aca00 is understood to be hexadecimal
5656
decimal^
great for humans; most arithmetic is done with this base
2’s complement binary^
this is what computers use, so get used to them
become familiar with how to do basic arithmetic with them
hex^
long strings of binary numbers are much better represented inhex