Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

MPI Tutorial-1

16.01.2024
17.01.2024
18.01.2024
22.01.2024
Contents

• Number Systems: Decimal, Binary, and Hexadecimal.


• Conversion of numbers into different number systems.
• BCD code.
• Packed and unpacked BCD codes.
• One Theoretical Question

1/15/2023 2

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


A. Number Systems

• Usage of multiple number system.


• Conversions from one system to others.
• Clarity of these ideas and interpretation of the obtained
results are very important.
• Humans are very much comfortable with decimal number
systems.
• Computers or microprocessors are operated on a different
number systems.

1/15/2023 3

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


1. Decimal Number Systems

• Base: 10 (Ten defined symbols)


• Symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
• Each symbol is called a ‘digit’.
• Combination of each symbol gives different
values.
• Position of the digit in a number is what gives
its value.

1/15/2023 4

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


2. Binary Number Systems

• Base: 2 (Two defined symbols)


• Symbols: 0, and 1.
• Each symbol is called a ‘bit’.
• Each position weights a power of 2.
• Example: (110110)2 = (54)10

1/15/2023 5

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


2. Binary Number Systems Continued…

• Concept of fractional binary numbers


• Example: (1001.011)2 = (9.375)10

1/15/2023 6

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


3. Hexadecimal Number Systems
• Base: 16 (Sixteen defined symbols)
• Symbols: 0 to 9; A to F
• A to F have the decimal equivalent from 10 to 15.
• Each symbol is called a ‘hex digit’.
• Each position weighs a power of 16.
• Example: (240FC)16 or 240FCH= (147708)10

1/15/2023 7

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


3. Hexadecimal Number Systems
• Example: (25.1)16 or 25.1H= (?)10

1/15/2023 8

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


B. Number Format Conversions
1. Decimal to Binary

Example 1: (25)10 = (?)2 Example 2: (0.35)10 = (?)2

(0.35)10 = (0.01011)2

(25)10 = (11001)2 Important Note: The process of successive


multiplication by 2 will continue till the desired
accuracy is achieved.
1/15/2023 9

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


B. Number Format Conversions
2. Decimal to Hexadecimal 3. Binary to Hexadecimal
⮚ For a hex digit, its decimal value
Example : (3479)10 = (?)16 ranges between 0 to 15.
⮚ Any hex digit can be written as a
group of 4 bits.
⮚ Thus maximum no of bits required
to convert a hex digit to binary is
4.

(3479)10 = (79D)16

1/15/2023 10

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


B. Number Format Conversions
3. Binary to Hexadecimal and vice versa continued…
Example : (4C57F)16 = (?)2

(4C57F)16 = (01001100010101111111)2
Conversion of long binary numbers
▪ Divide it into groups of 4 bits (starting from the right i.e., the LSB).
▪ Write the hex representation of each 4-bit binary group.

Example: (10111110000111110001)2 = (?)16

1/15/2023 11

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


Self Study Topics

• Octal Number System


• Conversion of any number to Octal
number systems and vice versa.

1/15/2023 12

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


C. Different Codes

1. BCD Code
• Many different binary codes are used in digital & electronic
circuits, each with its own specific use.
• Humans prefer decimal number systems.
• We need to convert these decimal numbers in to base-2
environment so that computers and digital electronic devices
understand.
• BCD or binary-coded decimals allow us to do the same.
• Key advantage of the BCD system: Each decimal digit is
represented by a group of 4 binary digits or bits similar to
Hexadecimal.
• 10 decimal digits (0 to 9): 4 bit long binary code.
1/15/2023 13

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


C. Different Codes

1. BCD Code Continued…


• Note that BCD is not the same as Hexadecimal code.
• Why?
– BCD numbers stop at 9 or binary 1001 2.
– Hexadecimal numbers stop at 15 or binary 1111 2.

• Thus in BCD, six combinations 10, 11, 12, 13, 14 and 15 are
considered forbidden and hence cannot be used.
• This will also introduce a correction factor of 6 which will be
discussed later.
• BCD is also known as 8421 code due to its weighted
codification originating as a result of 4 bit group representation.
1/15/2023 14

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


C. Different Codes

1. BCD Code Continued…


Example: (357)10
35710 = 0011 0101 0111 (BCD)

Note the following for BCD code:


⮚ Advantage: Allows easy conversion between decimal and binary.
⮚ Disadvantage: BCD code is wasteful as the states between 10 to 15 are
not used.
⮚ Applications: BCD finds applications, especially in digital displays.
⮚ There is also a concept of packed and unpacked BCD numbers.

1/15/2023 15

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


C. Different Codes

1. BCD Code Continued…


• Packed BCD Numbers
– Each digit is packed into 4 binary bits.
– Consider the following examples

• 9810 : 10011000 (BCD)


• 67510: 0110 0111 0101 (BCD)

• Unpacked BCD Numbers


– Each decimal digit is represented into 8 binary bits or as a byte.
– Consider the following example

• 9810 : 00001001 00001000 (BCD)

1/15/2023 16

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


C. Different Codes

1. BCD Code Continued…


• Conversion of BCD numbers to HEX and Binary
– Let us consider an example and learn the concept.

Find the binary, hex and packed BCD representation of the decimal
numbers 126 and 245. Also, write the packed BCD in the hex format.

1/15/2023 17

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


1. Consider a digital computer, which must perform data storage, movement, processing, and
control functions. You have provided by only gates and memory cells. Find out what functions
will supported by which elements.

To support the listed 4 functions, both gates and memory cells will be required.

Gate: Device that implements a simple Boolean or logical function.


Memory: Store a 1-bit of data and can be in one of two stable states at any time.

Interconnecting a large number of these fundamental devices, we can construct a computer.

Data storage: Memory cells


Data processing: Gates
Data movement: Paths among components to move data; memory  memory/ memory  gates  memory.
Control: Paths among components can carry control signals.
18

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION


End of Tutorial-1

1/15/2023 19

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

You might also like