Ones Complement
The ones complement operation is trivial to
perform: convert all of the 1s in
the number to 0s, and all of the 0s to 1s. See the
fourth column in Table 2.1 for
examples. We can observe from the table that in
the ones complement representat

Twos Complement
The twos complement is formed in a way similar to
forming the ones complement:
complement all of the bits in the number, but then add 1,
and if that addition
results in a carry-out from the most significant bit of the
number, discard
the c

Floating Point Numbers
The fixed point number representation, has a
fixed position for the radix point, and a fixed number of
digits to the left and
right of the radix point. A fixed point representation may
need a great many digits
in order to represent

NORMALIZATION, AND THE HIDDEN BIT
A potential problem with representing floating point
numbers is that the same
number can be represented in different ways, which makes
comparisons and
arithmetic operations difficult. For example, consider the
numerically

INSIDE THE
COMPUTER
Inside CPUs
Registers
The CPU uses registers to store
information temporarily
Values to be processed
Address of value to be fetched from memory
In general, the more and bigger the
registers, the better the CPU
Registers can be 8-, 16-,

NUMBERING
AND CODING
SYSTEMS
Converting
from Decimal
to Binary
Divide the decimal number by 2
repeatedly
Keep track of the remainders
Continue this process until the quotient
becomes zero
Write the remainders in reverse order
to obtain the binary number
E

DIGITAL
PRIMER
Logic Design
Using Gates
Decoders
Decoders are widely used for address
decoding in computer design
Address Decoders
(cont)
Address decoder for 9 (10012)
The output will be 1 if and
only if the input is 10012
HANEL
Address decoder for 5 (010

NUMBERING
AND CODING
SYSTEMS
Converting
from Hex to
Decimal
Convert from hex to binary and then to
decimal
Convert directly from hex to decimal
by summing the weight of all digits
Ex. 6B216 = 0110 1011 00102
1024 512 256 128 64 32 16 8 4 2 1
1
1
0
1
0
1
1

INSIDE THE
COMPUTER
The CPU is connected to memory and
I/O through strips of wire called a bus
Carries information from place to place
Address bus
Data bus
Control bus
Internal
Organization of
Computers
(cont)
Address bus
CPU
Read/
Write
HANEL
RAM
ROM
Pri

OUTLINES
HANEL
Microcontrollers and embedded
processors
Overview of the 8051 family
Department of Computer Science and Information Engineering
National Cheng Kung University, TAIWAN
2
MICROCONTROLLERS
AND
EMBEDDED
PROCESSORS
Microcontroller
vs. GeneralPur