Module 1.
Computer Fundamentals
Er. Tulshidas Mane
Asst. Prof. VPPCOE & VA
Module Outcomes
✔ Convert the given number into the specified number system.
✔ Perform the binary airthmetic operation on the given binary
numbers.
✔ Convert the given coded number into other specified code.
✔ Add the given two decimal numbers using BCD code. 2
Analog Vs Digital Example:
Analog Signal
Digital Signal
• Continuous
• Infinite range of values • More • Discrete
exact values, but more difficult • Finite range of values (2) •
to work with Not as exact as analog, but
easier to work with
A digital thermostat in a room displays a temperature of 72°. An analog
thermometer measures the room temperature at 72.482°. The analog
value is continuous and more accurate, but the digital value is more than
adequate for the application and significantly easier to process
electronically.
3
Example of Analog Vs Digital System
Digital
advantages:
Battery life
Programmability
Accuracy 4
The World is Analog
✔ The world we live in is analog.
✔ We are analog.
✔ Any inputs we can perceive are analog.
✔ For example,
– sounds are analog signals; they are continuous time and
continuous value.
– Our ears listen to analog signals and we speak with analog signals.
– Images, pictures, and video are all analog at the source and our
eyes are analog sensors.
– Measuring our heartbeat, tracking our activity, all requires
processing analog sensor information.
5
Examples of Analog Signal
✔ An analog signal can be any time-varying signal.
✔ Minimum and maximum values can be either positive or negative. ✔ They can
be periodic (repeating) or non-periodic.
✔ Sine waves and square waves are two common analog signals. ✔ Note that
this square wave is not a digital signal because its minimum value is negative.
✔ Video and Audio
volts
Sine
Wave
Random Periodic
23
Parts of Analog Signal
Period
(T)
Amplitude
(peak-to-peak)
Amplitude 1
(peak) Frequency:F = Hz
T
7
Pros and Cons Analog Signal
⮚ Advantages
✔ Major advantages of the Analog signal is infinite amount of data.
✔ Density is much higher.
✔ Easy processing.
⮚ Disadvantages
✔ Unwanted noise in recording.
✔ If we transmit data at long distance then unwanted disturbance is there.
✔ Generation loss is also a big con of analog signals. 8
Logic Levels
Before examining digital signals, we must define logic levels.
A logic
level is a voltage level that represents a defined digital
state. ✔ Logic HIGH: The higher of two voltages, typically 5
volts ✔ Logic LOW: The lower of two voltages, typically 0
volts
5.0 v
2.0 v Logic High Invalid
Logic
Level
0.8 v 0.0 v Logic Low
Logic Level Voltage True/False
HIGH 5 volts TrueLOW 0 volts Fals
9
Examples of Digital Signal
✔ Digital signal are commonly referred to as square waves or
clock signals.
✔ Their minimum value must be 0 volts, and their maximum
value must be 5 volts.
✔ They can be periodic (repeating) or non-periodic.
✔ The time the signal is high (tH) can vary anywhere from 1%
of the period to 99% of the period.
✔ Text and Integers.
5 volts
0 volts
10
Time signal is at 5 v.
Parts of High
Time Low (tL):
Digital Signal (tThe): H
The time the signal is
at 0 v.
time
Amplitude: the
For digital signals, this
will ALWAYSbe 5 volts.
Period:
The time it takes for a
periodic signal to repeat.
(seconds)
Frequency: AmplitudeTime
A measure of the number
of
occurrences of the signal
per second. (Hertz, Hz)
High Period (T) Frequency: Falling Edge Rising Edge
(tH)
Time Low (tL)
Duty Cycle: 11
The ratio of tH to the total period 1
(T). Rising Edge: F = Hz T
A 0-to-1 transition of the signal.
Falling Edge:
DutyCycle =t ×100%T
H
A 1-to-0 transition of the signal.
Pros and Cons Digital Signal
⮚Advantages
✔Because of their digital nature they can travel
faster in over digital lines.
✔Ability to transfer more data as compared to
analog.
⮚Disadvantages
✔Greater bandwidth is essential.
✔Systems and processing is more complex. 12
Example of using digital over analog:
Noisy channel
Noisy channel
✔ Digital systems are less
sensitive to
noise
✔ As long as 0 is distinguishable from 1
13
Analog Vs Digital specified range.
⮚Analog system ⮚Digital system
✔The physical quantities or
signals continuously over a
may vary
✔The physicalquantities or signals can
assume only discrete values.
✔Greater accuracy
14
Analog Vs DigitalX(t) X(t)
t
t
Digital signal
Analog signal
15
Advantages of Digital System over Analog System
✔Digital Systems are easier to
design ✔Information storage is easy
✔Accuracy & Precision are greater
✔Digital systems are more versatile
✔Digital circuits are less affected by noise
✔More digital circuitry can be fabricated on
IC chips
✔Reliability is more
16
Number System and Codes
17
Number System
✔A number system defines a set of
values used to represent quantity.
18
Different Number Systems
✔ Decimal Number System
- Base/Radix 10
✔ Binary Number System
- Base/Radix 2
✔ Octal Number System
- Base/Radix 8
✔ Hexadecimal Number System
Base/Radix 16
Decimal Number System
✔ Decimal number system contains ten unique
symbols
0,1,2,3,4,5,6,7,8 and 9
✔ Since counting in decimal involves ten symbols,
we can say that its base or radix is ten.
✔ It is a positional weighted system
20
Decimal Number System
✔In this system, any number (integer, fraction
or mixed) of any magnitude can be
represented by the use of these ten symbols
only
✔Each symbols in the number is called
a “Digit”
21
Decimal Number System
Structure:
MSD LSD
...... d d d d ....
Decimal No. 3 2 1 0
. d −1d −2
Positional Weights Decimal Point
−1 −2
10 10 10 10 10 10
3 2 1 0
22
Decimal Number System
✔ MSD: The leftmost digit in any number
representation, which has the greatest positional
weight out of all the digits present in that number is
called the “Most Significant Digit” (MSD)
✔ LSD: The rightmost digit in any number
representation, which has the least positional weight
out of all the digits present in that number is called
the “Least Significant Digit” (LSD)
23
Decimal Number System
⮚Examples
1214
1897
9875.54
24
Binary Number System
✔Binary number system is a positional
weighted system
✔It contains two unique symbols 0 and 1
✔Since counting in binary involves two
symbols, we can say that its base or radix is
two.
25
Binary Number System
✔A binary digit is called a “Bit”
✔A binary number consistsof a sequenceof
bits, each of which is either a 0 or a 1. ✔The
binary point separatesthe integer and
fraction parts
26
Binary Number System
Structure:
Binary No. ....
MSB LSBb2 b1 b0 ...... b3. b − 1 b − 2
Positional Weights 0 −1 −2
2 2 2 22 2
3 2 1
Binary Point
Binary Number System
✔MSB: The leftmost bit in a given binary number
with the highest positional weight is called the
“Most Significant Bit” (MSB)
✔LSB: The rightmost bit in a given binary number
with the lowest positional weight is called the
“Least Significant Bit” (LSB) 28
Binary Number System Decimal No. Binary No.
Decimal No. Binary No.
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000 12 1100
9 1001 13 1101
10 1010 14 1110
11 1011 15 1111
29
Terms related to Binary Numbers
✔BIT: The binary digits (0 and 1) are
called bits.
- Single unit in binary digit is
called “Bit”
- Example 1
0
30
Terms related to Binary Numbers
✔NIBBLE: A nibble is a combination of 4
binary bits.
1110
Examples,
0000
1001
0101
31
Terms related to Binary Numbers
✔ BYTE: A byte is a combination of 8 binary bits.
✔The number of distinct values represented by a byte is
256 ranging from 0000 0000 to 1111 1111.
b7 b6 b5 nibble
LSB
Higher order nibble
32
MSB
b4 b3 b2 b1 b0
Lower order
Terms related to Binary Numbers
✔WORD: A word is a combination of 16
binary bits. Hence it consists of two bytes.
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Higher order byte Lower order byte
MSB LSB
33
Terms related to Binary Numbers
✔DOUBLE WORD: A double word is exactly
what its name implies, two words.
-It is a combination of 32 binary bits. 34
Octal Number System system
✔Octal number system
is a positional weighted
✔It containseight unique
symbols0,1,2,3,4,5,6 and 7
✔Since counting in octal involves eight symbols,
we can say that its base or radix is eight.
35
Octal Number System
✔The largest value of a digit in the
octal system will be 7.
✔That means the octal number higher than 7
will not be 8, instead of that it will be 10.
36
Octal Number System
Structure:
Octal No. ....
MSD LSDO2 O1 O0 ...... O3. O− 1 O − 2
Positional Weights −1 −2
8 8 8 8 8 8
0 3 2 1
Radix Point37
Octal Number System
✔Since its base 8 = 23 , every 3 bit group of
binary can be represented by an octal digit.
✔An octal number is thus 1/3rd the length of
the corresponding binary number
38
Octal Number System
Decimal No. Binary No. Octal No.
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 10
9 1001 11
10 1010 12
11 1011 13
12 1100 14
13 1101 15
Hexadecimal Number System (HEX)
✔Binary numbers are long. These numbers are
fine for machines but are too lengthy to be
handled by human beings. So there is a need
to represent the binary numbers concisely.
✔One number system developed with this
objective is the hexadecimal number system
(or Hex)
Hexadecimal Number System (HEX)
✔Hex number system is a positional weighted
system
0,1,2,3,4,5,6,7,8,9,A,B,C,
✔It contains sixteen
D,E and F.
unique
symbols
✔Since counting in hex involves sixteen
symbols, we can say that its base or radix is
sixteen.
Hexadecimal Number System
(HEX)
Structure:
Hex No. −1 −2
MSD LSD...... H3 H2 H1 H0. H− 1 H − 2
16 16 16 16 16
3 2 1
....
Positional Weights 160
Radix Point
Hexadecimal Number System (HEX)
✔Since its base16 = 24, every 4 bit group of
binary can be represented by an hex digit.
th
✔An hex number is thus 1/4 the length of
the corresponding binary number
✔The hex system is particularly useful for
human communications with computer
Hexadecimal Number System (HEX)
Decimal No. Binary Hex No.
Decimal Binary No. Hex No.
No.
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 12 1100 C
9 1001 9 13 1101 D
10 1010 A 14 1110 E
11 1011 B 15 1111 F
Conversion Among Bases
Possibilities
Decimal Octal
Binary Hexadecimal
Conversion of Decimal number into Binary
number (Integer Number)
Procedure:
1. Divide the decimal no by the base 2, noting
the remainder.
2. Continue to divide the quotient by 2 until there
is nothing left, keeping the track of the
remainders from each step.
3. List the remainder values in reverse order to
find the number‟s binary equivalent
Example: Convert 105 decimal number in to it’s
equivalent binary number.
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
2
52 1
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
2 10
52 2 26
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
2 2 100
52 2 26 13
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
2 2 1001
52 2 26 13 2 6
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
2 2 10010
52 2 26 13 2 6 2 3
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
2 2 2321
52 2 26 13 2 6
100101
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
2 2 23210
52 2 26 13 2 6
1001011
Example: Convert 105 decimal number in to it‟s
equivalent binary number.
2 105
(105)10 =
2 2 23210 MSB
52 2 26 13 2
1001011
6 (1101001)2
LSB
Conversion of Decimal number into Binary number
(Fractional Number)
Procedure:
1. Multiply the given fractional number by base 2. 2. Record
the carry generated in this multiplication as MSB.
3. Multiply only the fractional number of the product in step
2 by 2 and record the carry as the next bit to MSB.
4. Repeat the steps 2 and 3 up to 5 bits. The last carry will
represent the LSB of equivalent binary number
Example: Convert 0.42 decimal number in
to it’s equivalent binary number.
Example: Convert 0.42 decimal number in
to it‟s equivalent binary number.
0.42 X 2 = 0.84 0
Example: Convert 0.42 decimal number in
to it‟s equivalent binary number.
0.42 X 2 = 0.84 0
0.84 X 2 = 1.68 1
Example: Convert 0.42 decimal number in
to it‟s equivalent binary number.
0.42 X 2 = 0.84 0
0.84 X 2 = 1.68 1
0.68 X 2 = 1.36 1
Example: Convert 0.42 decimal number in
to it‟s equivalent binary number.
0.42 X 2 = 0.84 0
0.84 X 2 = 1.68 1
0.68 X 2 = 1.36 1
0.36 X 2 = 0.72 0
Example: Convert 0.42 decimal number in
to it‟s equivalent binary number.
0.42 X 2 = 0.84 0
0.84 X 2 = 1.68 1
0.68 X 2 = 1.36 1
0.36 X 2 = 0.72 0
0.72 X 2 = 1.44 1
Example: Convert 0.42 decimal number in
to it‟s equivalent binary number.
0.42 X 2 = 0.84 0 0.84 X 2 = 1.68 1 0.68 X 2 = 1.36 1 0.36 X 2 =
0.72 0 0.72 X 2 = 1.44 1
MSBLSB
(0.42)10 = (0.01101)2
Exercise
• Convert following Decimal Numbers in to
its equivalent Binary Number:
1. (1248.56)10 = ( ? )2
2. (8957.75)10 = ( ? )2
3. (420.6)10 = ( ? )2
4. (8476.47)10 = ( ? )2
Conversion of Decimal Number into Octal Number
(Integer Number)
Procedure:
1. Divide the decimal no by the base 8, noting
the remainder.
2. Continue to divide the quotient by 8 until there
is nothing left, keeping the track of the
remainders from each step.
3. List the remainder values in reverse order to
find the number‟s octal equivalent
Example: Convert 204 decimal number in
to it’s equivalent octal number.
Example: Convert 204 decimal number in
to it‟s equivalent octal number.
8 204
Example: Convert 204 decimal number in
to it‟s equivalent octal number.
25
8 204 8 44
204 - 40 4
8 25 4 - 16
Example: Convert 204 decimal number in
to it‟s equivalent octal number.
3
8 204 8 25 8 3 8 1
4
25
- 24 1
Example: Convert 204 decimal number in to it‟s
equivalent octal number.
8 204
8 25 8 3 0 413
Example: Convert 204 decimal number in to it‟s
equivalent octal number.
8 204
LSD
8 25 8 3 0 4
1 3 MSD
(204)10 = (314)8
Conversion of Decimal Number into Octal Number
(Fractional Number)
Procedure:
1. Multiply the given fractional number by base 8. 2.
Record the carry generated in this multiplication as MSD.
3. Multiply only the fractional number of the product in step 2
by 8 and record the carry as the next bit toMSD. 4. Repeat the
steps 2 and 3 up to 5 bits. The last carry will represent the
LSD of equivalent octal number
Example: Convert 0.6234 decimal number in to
it’s equivalent Octal number.
Example: Convert 0.6234 decimal number in to it‟s
equivalent Octal number.
0.6234 X 8 = 4.9872 4
Example: Convert 0.6234 decimal number in to it‟s
equivalent Octal number.
0.6234 X 8 = 4.9872 4
0.9872 X 8 = 7.8976 7
Example: Convert 0.6234 decimal number in
to it‟s equivalent Octal number.
0.6234 X 8 = 4.9872 4
0.9872 X 8 = 7.8976 7
0.8976 X 8 = 7.1808 7
Example: Convert 0.6234 decimal number in
to it‟s equivalent Octal number.
0.6234 X 8 = 4.9872 4
0.9872 X 8 = 7.8976 7
0.8976 X 8 = 7.1808 7
0.1808 X 8 = 1.4464 1
Example: Convert 0.6234 decimal number in
to it‟s equivalent Octal number.
0.6234 X 8 = 4.9872 4
0.9872 X 8 = 7.8976 7
0.8976 X 8 = 7.1808 7
0.1808 X 8 = 1.4464 1
0.4464 X 8 = 3.5712 3
Example: Convert 0.6234 decimal number in to it‟s
equivalent Octal number.
0.6234 X 8 = 4.9872 4 0.9872 X 7.1808 7 0.1808 X 8 = 1.4464 1
8 = 7.8976 7 0.8976 X 8 = MSD
0.4464 X 8 = 3.5712 3 LSD (0.6234)10 =
(0.47713)8