log cast 1
TRANSCRIPT
-
8/4/2019 Log Cast 1
1/35
Logic Circuits and Switching Theory
Digital Electronics : A Practical Approach by William KleitzDigital Design by Morris Mano
Prepared by Engr. Nerissa L. Serrano
-
8/4/2019 Log Cast 1
2/35
A prerequisite to
understandingmicroprocessor system is
understanding Logic
Design CombiningSimple Blocks intoComplicated Systems
Physics
Devices
Analog
Circuits
Digital
Circuits
Logic
Micro-
architecture
Architecture
Operating
Systems
Application
Software
electrons
transistors
diodes
amplifiers
filters
AND gates
NOT gates
adders
memories
datapaths
controllers
instructions
registers
device drivers
programs
focus
ofthis
cour
se
-
8/4/2019 Log Cast 1
3/35
-
8/4/2019 Log Cast 1
4/35
Base 2, Base 3, Base 4, Base 5, Base 6,..
-
8/4/2019 Log Cast 1
5/35
Why Learn the Number System?
The computer does not understand the words andletters. Rather, those words and letters are translatedinto numbers. Computers talk and understand innumbers.
If you have an understanding of the number systems,you can understand how to calculate NetworkAddresses, Memory Address Locations in core dumps,Boolean Algebra, etc.
-
8/4/2019 Log Cast 1
6/35
Each system is characterized by the
number of independent digits or
symbols they use.
The number of symbols are often called
the base, radix, modulo, or mod.
-
8/4/2019 Log Cast 1
7/35
Binary (Base-2)0,1
Octal (Base-8)0,1,2,3,4,5,6,7
Decimal (Base-10)0,1,2,3,4,5,6,7,8,9
Hexadecimal (Base 16)
0,1,2,3,4,5,6,7,8,9,A,B
,C,D,E,F
-
8/4/2019 Log Cast 1
8/35
To indicate the type of number system used,the radix is used as a subscript.
e.g. 10101012
6548
A216
8910
NOTE: The absence of a subscript usually denotes Decimalnumber system
-
8/4/2019 Log Cast 1
9/35
GENERAL PRINCIPLES
1. Whenever it is desired to find the decimal equivalent ofa given number in another number system, it is given bythe sum of all the digits multiplied by their weights orplace values. The integer and fractional parts should be
handled separately. Starting from the radix point, theweights of different digits are r0, r1, r2 for the integer partand r1, r2, r3 for the fractional part, where r is the radix ofthe number system whose decimal equivalent needs to be
determined
-
8/4/2019 Log Cast 1
10/35
BASE-N to BASE-10 EXAMPLES
1. Convert 1011.18 to Decimal1011.1
x 0 = 1
x 1 =x = 0x 3 = 8
11.5
x -1 = 0.5
-
8/4/2019 Log Cast 1
11/35
BASE-N to BASE-10 EXAMPLES
2. Convert 27.158 to Decimal27.158
x 8-2 = 0.078125
x 8-1 = 0.125x 80 = 7x 81 = 16
23.203125
-
8/4/2019 Log Cast 1
12/35
BASE-N to BASE-10 EXAMPLES
3. Convert 4AC.816 to Decimal4AC.816x 16-1 = 0.5
x 160 = 12x 161 = 160x 162 = 1024
1196.5
-
8/4/2019 Log Cast 1
13/35
GENERAL PRINCIPLES
2. To convert a given mixed decimal number into an equivalentin another number system, the integer part is progressively
divided by r and the remainders noted until the result of
division yields a zero quotient. The remainders written in
reverse order constitute the equivalent. r is the radix of thetransformed number system. The fractional part is
progressively multiplied by r and the carry recorded until the
result of multiplication yields a zero or when the desired
number of bits has been obtained. The carrys written in forwardorder constitute the equivalent of the fractional part.
-
8/4/2019 Log Cast 1
14/35
BASE-10 toBASE-N Examples
1.Convert 235.5 to Binaryr Dividend R
2 235 1
2 117 1
2 58 0
2 29 12 14 0
2 7 1
2 3 1
2 1 1
0
0.5 x 2 = 1.0
Ans:
11101011.12
-
8/4/2019 Log Cast 1
15/35
BASE-10 toBASE-N Examples
1.Convert 99.8125 to Octal
r Dividend R
8 99 3
8 12 4
8 1 1
8
.8125 x 8 = 6.5
Ans: 143.648
.5 x 8 = 4.
-
8/4/2019 Log Cast 1
16/35
BASE-10 toBASE-N Examples
1.Convert 68.75 to Hex
r Dividend R
16 68 4
16 4 4
16 0
0.75 x 16 = 12.0
Ans: 44.C16
-
8/4/2019 Log Cast 1
17/35
GENERAL PRINCIPLES
3. For octalbinary conversion, replace each digit in the octal
number with its three-bit binary equivalent. For hexadecimalbinary
conversion, replace each hex digit with its four-bit binary equivalent.
For binaryoctal conversion, split the binary number into groups of
three bits, starting from the binary point, and, if needed, complete
the outside groups by adding Os, and then write the octalequivalent of these three-bit groups. For binaryhex conversion,
split the binary number into groups of four bits, starting from the
binary point, and, if needed, complete the outside groups by adding
Os, and then write the hex equivalent of the four-bit groups..
-
8/4/2019 Log Cast 1
18/35
Octal to Binary Example
1. Convert 4568 to Binary
4568
100 101 110
Ans: 1001011102
-
8/4/2019 Log Cast 1
19/35
Binary to Octal Example
Convert 1011101110112 to Octal
101101110112Ans: 26738
62 7 3
-
8/4/2019 Log Cast 1
20/35
Hex toBinary Conversion Example
Convert 5AF16 to Binary
5AF8
0101 1010 1111
Ans:
101101011112
-
8/4/2019 Log Cast 1
21/35
Binary to Hexadecimal Conversion
Convert 101110111011012 to Hex
101110111011012Ans:2EED16
E2 E D
-
8/4/2019 Log Cast 1
22/35
GENERAL PRINCIPLES
4. For octalhexadecimal conversion, we can gofrom the given octal number to its binaryequivalent and then from the binary equivalent toits hex counterpart. For hexadecimaloctal
conversion, we can go from the hex to its binaryequivalent and then from the binary number to itsoctal equivalent.
-
8/4/2019 Log Cast 1
23/35
Hex to Octal Conversion Example
Convert C3F16 to Octal
C3F16
1100 0011 1111
1100001111112
ANS:
60778
6 0 7 7
-
8/4/2019 Log Cast 1
24/35
Octal to Hex Conversion Example
Convert 1 to Hex
1
110 001 010
110001010
ANS: 1 A1
A1
-
8/4/2019 Log Cast 1
25/35
You have to learn these by heart!
Any Number System to Decimal
Multiply each digit by rn where ris the radix and n is the position
-
8/4/2019 Log Cast 1
26/35
You have to learn these by heart!
Decimal to Any Number System Whole number Successive Division.
The first digit of the answer is the last
remainder None-Whole Number Progressive
Multiplication.
-
8/4/2019 Log Cast 1
27/35
You have to learn these by heart!
Binary to Octal
Group the bits by 3 and convertdirectly
Binary to Hex Group the bits by 4 and convert
directly
-
8/4/2019 Log Cast 1
28/35
You have to learn these by heart!
Octal to Binary
Convert each digit to 3 bits
Hex to Binary Convert each digit to 4 bits
-
8/4/2019 Log Cast 1
29/35
You have to learn these by heart!
To convert Hex to Octal andOctal to Hex it is easier to
convert first to binary rather thanto decimal.
-
8/4/2019 Log Cast 1
30/35
Solve without using a calculator please
What is the Decimal Equivalent of
1234.315?
-
8/4/2019 Log Cast 1
31/35
What is the Decimal Equivalent of 1234.315?
1234.315x 5-2 = 0.04
x 5-1 = 0.6
x 50 = 4
x 52 = 50x 51 = 15
x 53 = 125
194.64
-
8/4/2019 Log Cast 1
32/35
Solve without using a calculator please
Convert 125.75 into its Base 4
equivalent.
-
8/4/2019 Log Cast 1
33/35
Convert 125.75 into its Base 4 equivalent.
r Dividend R
4 125 1
4 31 3
4 7 3
4 1 1
4 0
0.75 x 4 = 3.0
Ans: 1331.34
-
8/4/2019 Log Cast 1
34/35
Perform the indicated conversion:
1.3568 HEX
2.AE616 DEC
3.4108 BIN4.1203 OCT
5.101 OCT
6.13410 HEX
-
8/4/2019 Log Cast 1
35/35
Perform the indicated conversion:
1.3568 HEX = EE162.AE616 DEC = 2790
3.4108 BIN = 10000100024.1203 OCT = 1785.101 OCT = 14586.13410 HEX = 86