Thursday 26 August 2021

Digital electronics and microprocessor, ET-5th, computer, and others for engineering.

 66856                  Digital Electronics & Microprocessors                 T P C

                                                                                                                                                                2 3 3

OBJECTIVES

 

Upon completion of this content, students will be able to achieve and acquire knowledge, skills and attitude in the area of Digital Electronics and Microprocessors special emphasis on:

 Number system, Binary arithmetic, and codes

 Logic gates and Sequential logic circuits

 Semiconductor memories, A/D and D/A converters

 Microprocessors

 

SHORT DESCRIPTION

 

Basic Digital Circuits; Numbers systems and codes; Combinational logic circuits; Flip-flops and shift registers; Counters; A/D and D/A converters; Semiconductor memories; 8085, 8086 microprocessors.

 

DETAILS DECEPTION

Theory:

 

1. Understand Number systems and codes.

 

1.1 Describe binary, octal and Hexadecimal Number systems.

Numbers Representation Systems – Decimal, Binary, Octal, and Hexadecimal

In this article, we’ll discuss different number representation systems, where they are used and why they are useful. Briefly, we’ll go through decimal, binary, octal and hexadecimal number representation.

Decimal (base 10)

The most common system for number representation is the decimal. Everybody is using it. It’s so common that most people must believe that is the only one. It’s used in finances, engineering, and biology, almost everywhere we see and use numbers.

If someone is asking you to think at a number for sure you’ll think at a decimal number. If you think of a binary or hexadecimal one, you must have an extreme passion for arithmetic or software/programming.

As the name is saying the decimal number system is using 10 symbols/characters. In the Latin language, 10 is “decem” so decimal might be linked to the Latin word.

Decimal Symbols

0

1

2

3

4

5

6

7

8

9

As you can see there are 10 symbols from 0 to 9. With these symbols, we can construct all the numbers in the decimal system.

All the numbers in the decimal system can be constructed by using the above-mentioned symbols (0 … 9) multiplied with the power of 10. The power of ten gives us ones, tens, hundreds, thousands, and so on.

10 k  

10 5  

10 4  

10 3  

10 2  

10 1  

10 0  

N

100000

10000

1000

100

10

1

The example below breaks down the decimal number 67049 into powers of 10 multiplied with numbers between 0 and 9. This is just to show that any number in the decimal system can be decomposed into a sum of terms made off from the product of the power of 10 and the symbols 0 … 9.

67049

10 7  

10 6  

10 5  

10 4  

10 3  

10 2  

10 1  

10 0  

0

0

0

6

7

0

4

9

67049 =610 4 =60000 +710 3 +7000 +010 2 +0 +410 1 +40 +910 0 +9  

The same technique is going to be applied to the binary, octal and hexadecimal systems, is in fact a method of converting a number from the decimal system in another format (base).

We can keep in mind these characteristics of the decimal numbers system:

  • it’s using 10 symbols
  • can be decomposed in factors containing powers of 10
  • it’s the most common number representation system

Binary (base 2)

Let’s step into the geek side now.

Another number representation system is the binary one. As the name suggests and by analogy, with the decimal system we can say that the binary system is using only 2 symbols/characters:

Binary Symbols

0

1

In the binary representation, we only use 0 (zeros) and 1 (ones) to represent numbers.

The binary system is used wherever you want to store information in electronic format. All the computers that you know, intelligent devices, everything that has to do with electronics, and microcontrollers use the binary system.

In electronics (digital) all the operations are done using two levels of voltage: high and low. Each level of voltage is assigned to a value/symbol: HIGH for 1 and LOW for 0. For a microcontroller that is supplied with +5V the 1 (high) will be represented by +5 V and the 0 (low) by 0 V.

Roughly we can say that the binary system is used because it can be translated into an electronic signal.

All the decimal numbers we can think of can be represented in binary symbols. We do this by using a sum between terms of the power of 2 multiplied with 0 or 1.

2 k  

2 7  

2 6  

2 5  

2 4  

2 3  

2 2  

2 1  

2 0  

N

128

64

32

16

8

4

2

1

For example, we’ll use the number 149 (decimal representation) and transform it into a binary representation. We could use any number but if it’s too big it would end up into a long string of zeros and ones.

149

2 7  

2 6  

2 5  

2 4  

2 3  

2 2  

2 1  

2 0  

1

0

0

1

0

1

0

1

149 =12 7 =128 +02 6 +0 +02 5 +0 +12 4 +16 +02 3 +0 +12 2 +4 +02 1 +0 +12 0 +1  

As you can see the decimal number 149 is represented in the binary system by a series of zeros and ones (10010101). Usually to distinguish between decimal or binary numbers, we must specify the base to which we are referring to. The base is described as a subscript after the last character of the number

Example:

Decimal (base 10)

Binary (base 2)

149 10  

10010101 2  

By specifying the base of the number we eliminate the probability of confusion, because the same representation (e.g. 11) can mean different things for different bases.

11 2 ≠11 10  

Another way to avoid confusion is to use a special notation (prefix) for binary numbers. This is because 1100 can represent eleven hundreds in a decimal system or the decimal twelve represented in binary system. So if want to specify a binary number we use the prefix 0b. Example: 0b1100.

Briefly the characteristics of a binary system are:

  • it’s using 2 symbols
  • can be decomposed in factors containing powers of 2
  • it’s used in computers, microcontrollers

Octal (base 8)

All the numbers in the octal of the system are represented using 8 symbols/characters, from 0 to 7. The reason for using the octal system instead of the decimal one can be various. One of them is that instead of using our fingers for counting, we use the spaces between fingers.

Humans have 4 spaces between the fingers of one hand; in total we’ll have 8 spaces, for both hands. In this case, it makes sense to use an octal number representation system instead of a decimal one. The drawback is that higher numbers will require more characters compared to the decimal one.

Octal Symbols

0

1

2

3

4

5

6

7

To transform a decimal represented number into an octal system we split it into terms containing the power of 8:

8 k  

8 5  

8 4  

8 3  

8 2  

8 1  

8 0  

N

32768

4096

512

64

8

1

As an example we are going to represent the decimal number 67049 in octal base:

67049

8 5  

8 4  

8 3  

8 2  

8 1  

8 0  

2

0

2

7

5

1

67049 =28 5 =65535 +08 4 +0 +28 3 +1024 +78 2 +448 +58 1 +40 +18 0 +1  

Hexadecimal (base 16)

The hexadecimal number representation system is using 16 symbols/characters to define numbers. It’s used in computer science mostly because can represent bigger decimal numbers with fewer characters.

Hexadecimal Symbols

0

1

2

3

4

5

6

7

8

9

A

B

C

D

E

F

Compared with the decimal system it’s also using numeric symbols from 0 to 9. Additionally, it’s using alphanumeric characters from A to F for values between 10 and 15.

16 k  

16 5  

16 4  

16 3  

16 2  

16 1  

16 0  

N

1048576

65535

4096

256

16

1

To represent a decimal number in the hexadecimal format we split the decimal number into a sum of terms. Each term is a product between a hexadecimal symbol and a power of 16.

67049

16 4  

16 3  

16 2  

16 1  

16 0  

1

0

5

E

9

67049 =116 4 =65536 +016 3 +0 +516 2 +1280 +E16 1 +224 +916 0 +9  

The representation of the decimal number 67049 in hexadecimal format as 105E9. Similar to the binary system a common practice is to use the prefix “0x” to distinguish from the decimal notation. Example: 0x105E9.

Briefly the characteristics of a hexadecimal number representation system are:

  • it’s using 16 symbols
  • can be decomposed in factors containing powers of 16
  • it’s used in computers, microcontrollers

The table below summaries the characteristics of the above mentioned number representation systems.

 

 

System

Number of Symbols

Symbols

Prefix

Example

Decimal

10

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

None

147

Binary

2

0, 1

0b

0b10010011

Hexadecimal

16

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A,B, C, D, E, F

0x

0x93

Both the octal and hexadecimal number representation systems are linked to the computer system, mainly with the kind of processors and microcontrollers. For example, if the microprocessor is using 8-bit data then the octal system is suitable to interface data. If the microprocessor is on 16 bits then the hexadecimal system is appropriate to represent data

 

 

 

 

 

 

1.2 Convert one number system to another.

Number System Conversion

As we know, the number system is a form of expressing numbers. In number system conversion, we will study to convert several one base, to a number of another base. There are a variety of number systems such as binary numbers, decimal numbers, hexadecimal numbers, octal numbers, which can be exercised.

In this article, you will learn the conversion of one base number to another base number considering all the base numbers such as decimal, binary, octal and hexadecimal with the help of examples. Here, the following number system conversion methods are explained.

·         Binary to Decimal Number System

·         Decimal to Binary Number System

·         Octal to Binary Number System

·         Binary to Octal Number System

·         Binary to Hexadecimal Number System

·         Hexadecimal to Binary Number System

Get the pdf of a number system with a brief description in it. The general representation of number systems are;

Decimal Number – Base 10 = N10

Binary Number – Base 2 =N2

Octal Number – Base 8 = N8

Hexadecimal Number – Base 16 =N16

Number System Conversion Table

Binary Numbers

Octal Numbers

Decimal Numbers

 

Hexadecimal Numbers

0000

0

0

 

0

0001

1

1

 

1

0010

2

2

 

2

0011

3

3

 

3

0100

4

4

 

4

0101

5

5

 

5

0110

6

6

 

6

0111

7

7

 

7

1000

10

8

 

8

1001

11

9

 

9

1010

12

10

 

A

1011

13

11

 

B

1100

14

12

 

C

1101

15

13

 

D

1110

16

14

 

E

1111

17

15

 

F

Number System Conversion Methods

Number system conversions deal with the operations to change the base of the numbers. For example, to change a decimal number with base 10 to a binary number with base 2. We can also perform arithmetic operations like addition, subtraction, multiplication on the number system. Here, we will learn the methods to convert the number of one base to the number of another base starting with the decimal number system. The representation of number system base conversion in general form for any base number is;

(Number)b = dn-1 dn-2—–.d1 d0 . d-1 d-2 —- d-m

In the above expression, dn-1 dn-2—–.d1 d0 represents the value of integer part and d-1 d-2 —- d-m represents the fractional part.

Also, dn-1 is the Most significant bit (MSB) and d-m is the Least significant bit (LSB).

Now let us learn, conversion from one base to another.






Decimal to Other Bases

Converting a decimal number to other base numbers is easy. We have to divide the decimal number by the converted value of the new base.

Decimal to Binary Number:

,

 Suppose if we have to convert decimal to binary, then divide the decimal number by 2

Example 1. Convert (25)10 to binary number.

Solution: Let us create a table based on this question.

Operation

Output

Remainder

25 ÷ 2

12

1(MSB)

12 ÷ 2`

6

0

6 ÷ 2

3

0

3 ÷ 2

1

1

1 ÷ 2

0

1(LSB)

Therefore, from the above table, we can write,

(25)10 = (11001)2     completed on 19/8/21.

 

 

Decimal to Octal Number: next class on 22/8/21.

 

To convert decimal to the octal number we have to divide the given original number by 8 such that base 10 changes to base 8. Let us understand with the help of an example.

Example 2: Convert 12810 to octal number.

Solution: Let us represent the conversion in tabular form.

Operation

Output 

Remainder

128÷8

16

0(LSB)

16÷8

2

0

2÷8

0

2(MSB)

Therefore, the equivalent octal number = 2008

Decimal to Hexadecimal:

Again in decimal to hex conversion, we have to divide the given decimal number by 16.

Example 3: Convert  12810 to hex.

Solution: As per the method, we can create a table;

Operation

Output 

Remainder

128÷16

8

0(MSB)

8÷16

0

8(LSB)

Therefore, the equivalent hexadecimal number is 8016

Here MSB stands for a Most significant bit and LSB stands for a least significant bit.

Other Base System to Decimal Conversion

Binary to Decimal:

In this conversion, binary number to a decimal number, we use multiplication method, in such a way that, if a number with base n has to be converted into a number with base 10, then each digit of the given number is multiplied from MSB to LSB with reducing the power of the base. Let us understand this conversion with the help of an example.

Example 1. Convert (1101)2 into a decimal number.

Solution: Given a binary number (1101)2.

Now, multiplying each digit from MSB to LSB with reducing the power of the base number 2.

1 × 23 + 1 × 22 + 0 × 21 + 1 × 20

= 8 + 4 + 0 + 1

= 13

Therefore, (1101)2 = (13)10

Octal to Decimal:

To convert octal to decimal, we multiply the digits of octal number with decreasing power of the base number 8, starting from MSB to LSB and then add them all together.

Example 2: Convert 228 to decimal numbers.

Solution: Given, 228

2 x 81 + 2 x 80

= 16 + 2

= 18

Therefore, 22= 1810

Hexadecimal to Decimal:

Example 3: Convert 12116 to decimal number.

Solution: 1 x 162 + 2 x 16 + 1 x 160

= 16 x 16 + 2 x 16 + 1 x 1

= 289

Therefore, 12116 = 28910

Hexadecimal to Binary Shortcut Method

To convert hexadecimal numbers to binary and vice versa are easy, you just have to memorize the table is given below.

Hexadecimal Number

Binary

0

0000

1

0001

2

0010

3

0011

4

0100

5

0101

6

0110

7

0111

8

1000

9

1001

A

1010

B

1011

C

1100

D

1101

E

1110

F

1111

You can easily solve the problems based on hexadecimal and binary conversions with the help of this table. Let us take an example.

Example: Convert (89)16 into a binary number.

Solution: From the table, we can get the binary value of 8 and 9, hexadecimal base numbers.

8 = 1000 and 9 = 1001

Therefore, (89)16 = (10001001)2

Octal to Binary Shortcut Method

To convert octal to binary number, we can simply use the table. Just like having a table for hexadecimal and its equivalent binary, in the same way, we have a table for octal and its equivalent binary number.

Octal Number

Binary

0

000

1

001

2

010

3

011

4

100

5

101

6

110

7

111

Example: Convert (214)8 into a binary number.

Solution: From the table, we know,

2 → 010

1 → 001

4 → 100

Therefore,(214)8 = (010001100)2

Practice Problems on Number System Conversion

1.     Convert 14610 into a binary number system

2.     Convert  1A716 into the decimal number system

3.     Convert (110010)2 into octal number system

4.     Convert DA216 into the binary number system

5.     Convert 46528  into the binary number system

Frequently Asked Question on the Number System Conversion

Why do we need the number system conversion?

One of the most important applications of the number system is in computer technology. Generally, a computer uses the binary number system, but humans will use the hexadecimal number system, as it is easier to understand. For this reason, the number system conversion is required.

What is meant by the base 2 number system?

The base 2 the number system is called the binary number system. It uses only two digits, such as 0, 1. For example, the number 6 is represented by 0110 (or) 110.

Write down the conversion procedure from decimal to binary number system?

The steps to convert the decimal number system to binary number system are:
Divide the given number by 2
Now, use the obtained quotient for the next iteration
Obtain the remainder for the binary number
Repeat the steps until the quotient is equal to 0

What is meant by the base 8 number system?

The base 8 number system is called the octal number system. It uses the digits such as 0, 1, 2, 3, 4, 5, 6, 7.

What is meant by the hexadecimal number system?

The hexadecimal number system is called the base 16 number system. It uses the digits from 0 to 9, and A, B, C, D, E, F

 

 

 

 

 

 

 

1.3 Compute binary, Octal, and hexadecimal arithmetic.

 

Convert Hexadecimal To Octal

In the number system, we come across four different types of the number system, i.e. hexadecimal, octal, decimal, and binary. The conversion of these numbers from one form to another is possible. To convert hexadecimal to octal numbers, we need to convert hexadecimal to its equivalent decimal number first and then decimal to octal. Before this conversion, first, go through the basic definition of hexadecimal and octal numbers.

What Are Hexadecimal Numbers?

Hexadecimal numbers are the numbers which have base 16. It uses 16 different digits to represent the numbers. It is denoted as h16, where h is a hexadecimal number. It may be a combination of alphabets and numbers. Thus, it includes numbers from 0 to 9 and alphabets A to F.

Example: (AB2)16, (98D1)16, (AFD)16

What are Octal Numbers?

Octal numbers have base 8. These numbers use digits from 0 to 7, total 8 digits and hence, they are called octal number systems. Octal numbers have base 8. It is denoted as o8 and o is an octal number. It does not use digits 8 and 9 to represent a number.

Example: (112)8, (275)8,(45)8

Hexadecimal to Octal Conversion

Conversion of hexadecimal to octal cannot be done directly. Firstly we need to convert hexadecimal into its equivalent decimal number then decimal to octal. Follow the steps below to understand the process.

·         Consider the given hexadecimal number

·         First count the number of digits in the number

·         If n is the position of the digit from the right end then multiply each digit with 16n-1

·         Add the terms after multiplication

·         Resultant is the equivalent decimal form

·         Divide the decimal number with 8

·         Note down the remainder

·         Repeat the previous two steps with the quotient, until the quotient is zero

·         Write the remainders in reverse order

·         The obtained number is the required result


Another Method to Convert Hex to Octal

There is another method to convert any hexadecimal to its equivalent octal. As we know, hexadecimal numbers include binary digits; therefore, we can club these binary numbers into a pair so that we can relate it with the octal numbers. Let us check the method with steps and examples:

·         For each given hexadecimal number digit, write the equivalent binary number. If any of the binary equivalents are less than 4 digits, add 0’s to the left side.

·         Combine and make the groups of binary digits from right to left, each containing 3 digits. Add 0’s to the left if there are less than 3 digits in the last group.

·         Find the octal equivalent of each binary group.

Let us see an example here:

Example: Convert 1BC16 into an octal number.

Solution: Given, 1BC16 is a hexadecimal number.

1 → 0001, B → 1011, C →1100

Now group them from right to left, each having 3 digits.

000, 110, 111, 100

000→0, 110 →6, 111→7, 100→4

Hence, 1BC16 = 6748

Hex to Octal Conversion Table

Hexadecimal

Octal

Equivalent Decimal

Equivalent Binary

0

0

0

0

1

1

1

1

2

2

2

10

3

3

3

11

4

4

4

100

5

5

5

101

6

6

6

110

7

7

7

111

8

10

8

1000

9

11

9

1001

A

12

10

1010

B

13

11

1011

C

14

12

1100

D

15

13

1101

E

16

14

1110

F

17

15

1111

Hexadecimal to Octal Questions

Q.1: Find the equivalent octal form of C116.

Solution: Given, a hexadecimal number is C1

C116 = (C × 161) + (1 × 160)

= C × 16 + 1 × 1

=12 × 16 + 1

= 192 + 1

C116 =193 (Decimal form)

Now we have to convert this decimal to octal number;

The octal number is 3018

Hence, C116 = 3018

Q.2: Find the equivalent octal form of F16.

Solution: Given, a hexadecimal number is F.

F16 = (F × 160)

= F × 1

= F

= 15(Decimal form)

Now we have to convert this decimal to equivalent octal number;

The octal number is 178

Hence, F16 = 178

Q.3: Find the equivalent octal form of 10516

Solution: Given, a hexadecimal number is 105.

10516 = (1 × 162) + (0 × 161) + (5 × 160)

= 1×256 + 0 × 16 + 5 × 1

=256 + 0 +5

= 261(Decimal form)

Now we have to convert this decimal to equivalent octal;

The octal number is 4058

Hence, 10516 = 4058

Practice Questions

1.       Convert ABCD16 to equivalent octal form.

2.       Convert 91216 to equivalent octal form.

3.       Convert 216 to equivalent octal form.

4.       Convert 1016 to equivalent octal form

 

 

 

 

1.4 Describe BCD Code, Excess- 3 Code, Gray Code, Alphanumeric Codes.

 

BCD (binary-coded decimal), also called alphanumeric BCD, alphameric BCD, BCD Interchange Code, or BCDIC is a family of representations of numerals, uppercase Latin letters, and some special and control characters as six-bit character codes.

 

What is the BCD code excess-3 code and gray code?

 

Excess-3 Code is a non-weighted BCD (8421) Code. Excess-3 Code is derived from 8421 code by adding 0011 (3) to all code groups. It is a sequential code, thus can be also used for performing arithmetic operations.
...
Excess-3 Code.

Decimal Numbers

Binary Numbers

Excess-3 Code (Binary Number + 0011)

8

1000

1011

9

1001

1100

 

 

What are BCD and GREY code?

 

Binary Coded Decimal (BCD) is a way to store the decimal numbers in binary form. The number representation requires 4 bits to store every decimal digit (from 0 to 9). Since there are 10 different combinations of BCD, we need at least a 4-bit Gray Code to create a sufficient number of these combinations.

 

Different Types of Binary Codes | BCD (8421), 2421, Excess-3, Gray

·         Binary Weights.

·         8421 Code or BCD Code.

·         2421 Code.

·         5211 Code.

·         Reflective Code.

·         Sequential Codes.

 

How do I find my BCD code?

 

Simply divide the binary number into groups of four digits, starting with the least significant digit, and then write the decimal digit represented by each 4-bit group. Add additional zero's at the end if required to produce a complete 4-bit grouping. So for example, 1101012 would become: 0011 01012 or 3510 in decimal.

 

How do I change my BCD code from excess-3?

Excess-3 to BCD conversion

The BCD code can be calculated by subtracting 3, i.e., 0011 from each four-digit Excess-3 code.

 

 

What is Gray code example?

 

Gray Code system is a binary number system in which every successive pair of numbers differs in only one bit. ... For example, the states of a system may change from 3(011) to 4(100) as- 011 — 001 — 101 — 100.

 

Where is GREY code used?

 

Gray codes are widely used to prevent spurious output from electromechanical switches and to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems.

 

 

 

 

 

1.5 Convert one type of code to another.

1.6 Describe the method of error detection and correction by using Parity bit.

1.7 Describe the function of Hamming code.

CODES

BCD, XS-3, Gray Code, Alphanumeric Codes (ASCII, EBCDIC), Error detecting and correcting codes (Parity Code, Hamming Code)

 

Classification of codes

Codes


Weighted Codes

Non-weighted Code

Reflective Codes

Sequential Code

Alphanumeric Error detecting and correcting Codes

 

1. Weighted Codes

Obey positional weight principle.

A specific weight is assigned to each position of the number.  Eg. : Binary, BCD codes

 

2. Non-weighted Codes

Do not obey the positional weight principle.

Positional weights are not assigned.

Eg.: excess-3 code, Gray code

 

3. Reflective Codes

A code is said to be reflective when code for 9 is the complement of code for 0, code for 8 is the complement of code for 1, code for 7 is the complement of code for 2, code for 6 is the complement of code for 3, code for 5 is the complement of code for 4.

Reflectivity is desirable when 9’s complement has to be found.

Eg.: excess-3 code

 

4. Sequential Codes

A code is said to be sequential when each succeeding code is one binary number greater than preceding code.

Eg.: Binary, XS-3

5. Alphanumeric Codes

Designed to represent numbers as well as alphabetic characters.

Capable of representing symbols as well as for instructions.

Eg.: ASCII, EBCDIC

6. Error Detecting and Correcting Codes

When digital data is transmitted from one system to another, an unwanted electrical disturbance called ‘noise’ may get added to it.

This can cause an ‘error’ in digital information. That means a 0 can change to 1 or 1 can change to 0.

To detect and correct such errors special types of codes capable of detecting and correcting the errors are used.

Eg.: Parity code, hamming code.

 

BCD (Binary Coded Decimal) Code

In this code each digit is represented by a 4-bit binary number.

The positional weights assigned to the binary digits in BCD code are 8-4-2-1 with 1 corresponding to LSB and 8 correspond to MSB.

 

Other BCD codes like 7-4-2-1, 5-4-2-1 etc. also exist.

 

Conversion from decimal to BCD

The decimal digits 0 to 9 are converted into BCD, exactly in the same way as binary.

 

Invalid BCD codes:

With 4 bits we can represent a total of sixteen numbers (0000 to 1111) but in BCD only first, ten codes are used (0000 to 1001)

Therefore remaining six codes (1010 to 1111) are invalid in BCD

 

Conversion of bigger decimal numbers to BCD:

Express each decimal digit with its equivalent 4-bit BCD code

Eg.: Convert (964)10to its equivalent BCD code.

 

There fore (964)10= (1001 0110 0100)BCD

Hence smallest number in BCD is 0000 i.e., 0 and largest is 1001 i.e., 9 after which 10 will be expressed by combinations i.e., 0001 0000, and is known as packed BCD

 

Comparison with Binary:

Less efficient than binary, since the conversion of a decimal number into BCD needs more bits than in binary

 

Eg., (22)10= (10110)2= (0010 0010)BCDSo BCD uses more bits than binary for the same decimal number.

BCD arithmetic is more complicated than binary arithmetic.

BCD –decimal conversion is simpler than Binary –decimal conversion.

Decimal Number →

   9

    6

    4

Binary Equivalent →

1001

0110

0100

Advantages of BCD codes:

Its similar to the decimal number system.

We need to remember binary equivalents of decimal numbers 0 to 9 only.

Conversions from decimal to BCD or BCD to decimal is very simple and no calculation is needed.

 

Disadvantages of BCD codes:

Less efficient than binary, since the conversion of a decimal number into BCD needs more bits than in binary

BCD arithmetic is more complicated than binary arithmetic.

 

-------------------------------------------------------------------------------------------------------------

Convert the following decimal numbers to BCD:

(a)164 (b) 4297 (c) 8065

 

Convert following BCD codes to decimal equivalent:

(a)1001 1000 (b) 0001 0100 0110 (c) 0111 0011 0101

 

Convert the following binary numbers to BCD codes :( Hint: convert to decimal first)

(a) 1100 (b) 10001 (c) 1010101

 

Convert following BCD codes to binary equivalent :( Hint: convert to decimal first)

(a) 0010 1000(b) 1001 0111(c) 1000 0000

 

XS-3 (Excess-3)Code

Non-weighted code.

Derived from BCD code (8-4-2-1 code)words by adding (0011)2 or (3)10 to each codeword.

 

Decimal BCD XS-3

Therefore Hence smallest number in XS-3 is 0011 i.e., 0, and largest is 1100 i.e., 9

 

Write each digit in 4-bit binary code

+ (0011)Decimal

BCD

XS-3

0

0000

0011

1

0001

0100

2

0010

0101

3

0011

0110

4

0100

0111

5

0101

1000

6

0110

1001

7

0111

1010

8

1000

1011

9

1001

1100

Conversion of decimal numbers XS-3 code:

Eg.: Convert (964)10to its equivalent XS-3 code.

 

Therefore (964)10= (1100 1001 0111)XS-3

Conversion of XS-3 code to equivalent decimal numbers :

Eg.: Convert (0011 1010 1100)XS-3to its equivalent decimal number.

 

Therefore (1010 0011 1100)XS-3= (709)10

 

Obtain XS-3 equivalent of following numbers:

(a) (235)10(b) (146)10(c) (0111 1000)BCD(d) (1001 0011)BCD

(e) (101010)2(hint: first convert to decimal)Decimal Number →

9

6

4

XS-3 Equivalent →

1100

1001

0111

Gray Code

Non-weighted code.

It has a very special feature that only one bit will change, each time the decimal number is incremented, therefore also called unit distance code.

 

Binary and Gray conversions:

For Gray to binary or binary to Gray conversions let’s understand rules for Ex-OR

 

(Ex-OR is represented by symbol)

Rules for EX-OR: Decimal

Binary

Gray Code

0

0000

0000

1

0001

0001

2

0010

0011

3

0011

0010

4

0100

0110

5

0101

0111

6

0110

0101

7

0111

0100

8

1000

1100

9

1001

1101

10

1010

1111

11

1011

1110

12

1100

1010

13

1101

1011

14

1110

1001

15

1111

1000

 

Conversion from Binary to Gray code:

 

Step 1: Write MSB of given Binary number as it is.

Step 2: Ex-OR this bit with the next bit of that binary number and write the result.

Step 3: Ex-OR each successive sum until the LSB of that binary number is reached.

Eg.: Convert (1010011)2to its equivalent Gray code.

 

1010011

1111010

Therefore (1010011)2= (1111010) Gray

Conversion from Gray to Binary:

 

Step 1: Write MSB of given Binary number as it is.

Step 2: Ex-OR this bit with the next bit of that binary number and write the result.

Step 3: Continue this process until the LSB of that binary number is reached.

Eg.: Convert (1010111)Gray to its equivalent Binary number.

 

1010111

1100101

Therefore (1010111)Gray = (1100101)2

Alphanumeric Codes

A binary bit can represent only two symbols ‘0’ and ‘1’. But it is not enough for communication between two computers because there we need many more symbols for communication.

These symbols are required to represent

-26 alphabets with capital and small letters

-Numbers from 0 to 9

-Punctuation marks and other symbols

Alphanumeric codes represent numbers and alphabetic characters. They also represent other characters such as punctuation symbols and instructions for conveying information.

Therefore instead of using only single binary bits, a group of bits is used as a code to represent a symbol.

The ASCII code

 

 

 

Encode the following in ASCII code:

1. We the people

 

ASCII-(American Standard Code for Information Interchange)

Universally accepted alphanumeric code.

Used in most computers and other electronic equipment. Most computer keyboards are standardized with ASCII.

When a key is pressed, its corresponding ASCII code is generated which goes to the computer.

Contains 128 characters and symbols.

Since 128 = 27hence we need 7 bits to write 128 characters. Therefore ASCII is a 7 bit code.

Can be represented in 8 bits by considering MSB = 0 always.

Hence we have ASCII codes from 0000 0000 to 0111 1111 in binary or from 00 to 7F in hexadecimal.

The first 32 characters are non-graphic control commands (never displayed or printed) eg. null, escape

The remaining characters are graphic symbols (can be displayed and printed). This includes alphabets (capital and small), punctuation signs, and commonly used symbols.

So ASCII code consists of 94 printable characters, 32 non-printable control commands and “Space” and “Delete” characters = 128 characters

 

----------------------------------------------------------------------------------------------------------------------------

Using ASCII table obtain ASCII code word for

(a) DEL, (b) %, ( c) W, (d) g,  (e) &

 

EBCDIC-(Extended Binary Coded Decimal Interchange Code)

8-bit code.

Total 256 characters are possible, however, all are not used.

There is no parity bit used to check error in this code set.

 

--------------------------------------------------------------------------------------------------------------------

Using code table obtain EBCDIC code word for

(a) NUL, (b) & (c) m (d) SP (e) –

 

 

 

 

 

 

 

Error detecting and correcting codes

When a digital information is transmitted, it may not be received correctly by the receiver.

The error is caused due to electrical disturbance of circuit it is also called noise.

This noise may force ‘1’ to change to ‘0’ or vice versa.

This error has to be detected and corrected.

 

---------------------------------------------------------------------------------------------------------------

Parity:

For detection of error an extra bit (parity bit) is attached to code.

For example: If a 7-bit data (1010110) is to be transmitted then it can be transmitted as 8-bit word (01010110) i.e., even parity codeword or as (11010110) i.e., odd parity codeword.

Where parity is decided by extra MSB (parity bit) which is introduced in original data.

If total number of ‘1’s in transmitted/ received word is even then parity is even.

If total number of ‘1’s in transmitted/ received word is odd then parity is odd.

 

 

 

 

 

1.7 Describe the function of Hamming code.

 

Hamming Code - Error Detection and Error Correction AUGUST 10, 2021

The hamming code technique, which is an error-detection and error-correction technique, was proposed by R.W. Hamming. Whenever a data packet is transmitted over a network, there are possibilities that the data bits may get lost or damaged during transmission.

Let's understand the Hamming code concept with an example:

Let's say you have received a 7-bit Hamming code which is 1011011.

First, let us talk about the redundant bits.

The redundant bits are some extra binary bits that are not part of the original data, but they are generated & added to the original data bit. All this is done to ensure that the data bits don't get damaged and if they do, we can recover them.

Now the question arises, how do we determine the number of redundant bits to be added?

We use the formula, 2r >= m+r+1; where r = redundant bit & m = data bit.

From the formula we can make out that there are 4 data bits and 3 redundancy bits, referring to the received 7-bit hamming code.

What is Parity Bit?

To proceed further we need to know about parity bit, which is a bit appended to the data bits which ensures that the total number of 1's are even (even parity) or odd (odd parity).

While checking the parity, if the total number of 1's are odd then write the value of parity bit P1(or P2 etc.) as 1 (which means the error is there ) and if it is even then the value of the parity the bit is 0 (which means no error).


Hamming Code: Error Detection

As we go through the example, the first step is to identify the bit position of the data & all the bit positions which are powers of 2 are marked as parity bits (e.g. 1, 2, 4, 8, etc.). The following image will help in visualizing the received hamming code of 7 bits.

First, we need to detect whether there are any errors in this received hamming code.

Step 1: For checking parity bit P1, use check one and skip one method, which means, starting from P1 and then skip P2, take D3 then skip P4 then take D5, and then skip D6 and take D7, this way we will have the following bits,

As we can observe the total number of bits is odd so we will write the value of parity bit as P1 = 1. This means the error is there.

Step 2: Check for P2 but while checking for P2, we will use the check two and skip two methods, which will give us the following data bits. But remember since we are checking for P2, so we have to start our count from P2 (P1 should not be considered).

As we can observe that the number of 1's are even, then we will write the value of P2 = 0. This means there is no error.

Step 3: Check for P4 but while checking for P4, we will use the check four and skip four methods, which will give us the following data bits. But remember since we are checking for P4, so we have started our count from P4(P1 & P2 should not be considered).

As we can observe that the number of 1's are odd, then we will write the value of P4 = 1. This means the error is there.

So, from the above parity analysis, P1 & P4 are not equal to 0, so we can clearly say that the received hamming code has errors.


Hamming Code: Error Correction

Since we found that the received code has an error, so now we must correct them. To correct the errors, use the following steps:

Now the error word E will be:

Now we have to determine the decimal value of this error word 101 which is 5 (22 *1 + 21 * 0 + 20 *1 = 5).

We get E = 5, which states that the error is in the fifth data bit. To correct it, just invert the fifth data bit.

So the correct data will be:


Conclusion:

So in this article, we have seen how the hamming code technique works for error detection and correction in a data packet transmitted over a network.

 

1.8 Describe the applications of codes.

 

What's the use of coding?

 

Simply put, coding is used for communicating with computers. People use coding to give computers and other machines instructions on what actions to perform. Further, we use it to program the websites, apps, and other technologies we interact with every day.

What is APPlication source code?

 

Source code is the list of human-readable instructions that a programmer writes—often in a word processing program—when he is developing a program. The source code is run through a compiler to turn it into machine code, also called object code, that a computer can understand and execute.

 

Where is coding used in everyday life?

 

Programming is everywhere in the modern world and meets you in the street, your workplace, and the local grocery store. You interact with bar-code scanners regularly, and you almost certainly use lots of code while working, whether you're using a word processor to write a letter or an email platform to send messages.

 

 

How do you explain a program?

 

In computing, a program is a specific set of ordered operations for a computer to perform. In the modern computer that John von Neumann outlined in 1945, the program contains a one-at-a-time sequence of instructions that the computer follows. Typically, the program is put into a storage area accessible to the computer.

 

What is difference between source code and object code?

 

The basic difference between source code and object code is that source code is written by a programmer while an object code is produced when a source code is compiled. Source code is created with a text editor or a visual programming tool and then saved in a file and object code is processed by the CPU in a computer.

 

Why source code is important?

 

Source code serves the needs of companies who have procedures in place that they want to retain regardless of the software installed. Some companies consider source code as a way to guarantee that the software changes as their company's needs change in the future.

 

What are the advantages of coding?

 

 

Why learn to code? 6 Surprising benefits to consider

·         Coding and programming careers have great earning potential. ...

·         Demand remains strong for coding-related jobs. ...

·         Coding ability gives a new perspective to problem-solving. ...

·         Learning to code offers career flexibility. ...

·         Learning to code can be a fun bonding opportunity for families.

 

What are the 4 types of programming language?

 

The 4 types of programming Language that is classified are:

·         Procedural Programming Language.

·         Functional Programming Language.

·         Scripting Programming Language.

·         Logic Programming Language.

·         Object-Oriented Programming Language.

Apr 21, 2021

 

 

 

 

What are the seven major steps in programming?

 

 

The seven steps of programming.

·         Step 1: Define the Program Objectives. ...

·         Step 2: Design the Program. ...

·         Step 3: Write the Code. ...

·         Step 4: Compile. ...

·         Step 5: Run the Program. ...

·         Step 6: Test and Debug the Program. ...

·         Step 7: Maintain and Modify the Program.

 

Which is the No 1 programming language?

 

PYPL Index: The PYPL PopularitY of Programming Language Index is created by analyzing how often language tutorials are searched on Google. The index is updated once a month.
...
PYPL Index (US)

Aug 2021

Programming language

Share

1

Python

31.47 %

2

Java

19.14 %

3

JavaScript

7.49 %

4

C#

6.24 %

 

What are the main steps to develop a program?

 

The following are six steps in the Program Development Life Cycle:

·         Analyze the problem. The computer user must figure out the problem, then decide how to resolve the problem - choose a program.

·         Design the program. ...

·         Code the program. ...

·         Debug the program. ...

·         Formalize the solution. ...

·         Document and maintain the program.

 

What are the five steps in program planning?

 

·         Determine your personal needs.

·         Consider your program options.

·         Set goals.

·         Structure your program and write it down.

·         Keep a log and evaluate your program.

 

2. Understand the basic digital circuits.

 

2.1 Describe the digital signals.

2.2 State the main features of digital systems.

2.3 Describe AND, OR, NOT, NAND, NOR, and XOR operations.

2.4 Describe the realization of basic logic operations using NAND and NOR gates.

2.5 Describe the Boolean algebraic theorems.

2.6 Simplify the logic expressions by using Boolean algebra.

2.7 Simplify the logic expressions by using the Karnaugh map (up to 4 Variables).

2.8 Describe the characteristics of digital ICs.

2.9 Describe different types of digital logic families.

 

 

3. Understand Combinational Logic Circuits.

 

3.1 Describe the operation of a digital multiplexer and DE multiplexer.

3.2 Describe the operation of half adder and full adder.

3.3 Describe the operation of half subtractor and full subtractor.

3.4 Explain the function of arithmetic logic unit (ALU) with block diagram.

3.5 Describe the operation of digital comparators.

1.7 Describe the function of parity generator/checkers.

1.8 Describe the function of priority encoders and BCD-to-7 segment decoder with block diagram

 

 

 

 

 

 

4. Understand Flip-Flops and shift registers.

 

4.1 Describe the operation of a sequential circuit with a block diagram.

4.2 Describe the working principle of clocked SR flip-flop, D-type flip-flop, and T-type flip-flop J-K flip-flop, Master-slave flip-flop.

4.3 State the applications of flip-flops.

4.4 Describe the function of registers.

4.5 Describe the operation of shift registers.

4.6 Mention the applications of shift registers.

4.7 List some common ICs used as flip-flops and shift registers.

 

5. Understand the Counters.

 

5.1 Describe the operation of ripple or asynchronous counters.

5.2 Describe the principle of UP/DOWN counters.

5.3 Describe the modulus of the Counter.

5.4 Describe the operation of synchronous counters.

5.5 Explain the function of the universal counter.

5.6 Describe the principle of the ring counter.

5.7 List some common ICs used as a counter with a block diagram.

 

 

 

 

 

 

 

6. Understand the D/A converter.

 

6.1 Mention the principle of level conversion.

6.2 Describe the principle of D/A conversion.

6.3 Mention the types of D/A converter.

6.4 Explain the operation of a binary-weighted D/A and R-2R ladder D/A converter.

6.5 State the terms – resolution, percentage of resolution, accuracy.

6.6 Offset error and settling time as the specification of the D/A converter.

6.7 State the application field of the D/A converter.

6.8 List the application of popular D/A converter ICS.

 

7. Understand A/D converter.

 

7.1 State the principle of A/D conversion.

7.2 List the type of A/D converter.

7.3 State the working principle of a 3-bit parallel A/D converter.

7.4 Describe the operation of the Digital Ramp A/D converter

7.5 Explain the principle of operation of successive approximation, dual-slope, and Flash A/D converter.

7.6 State the terms – resolution, accuracy, and conversion time as the specification of the A/D converter.

7.7 List the applications of popular A/D converter ICS.

7.8 Describe the operation of sample & hold circuits and their application.

 

 

8. Understand the features of Semiconductor Memories.

 

8.1 Describe the operation of a memory device with a block diagram.

8.2 Describe the concept of READ and WRITE operation of memories.

8.3 Mention the classification of memories.

8.4 Mention the characteristics of memories.

8.5 Explain the principle of sequential memory.

8.6 Mention the characteristics of ROM, PROM, EPROM, EEPROM and Flash memory.

8.7 Mention the principle of static and dynamic RAM.

8.8 List some commercial memory ICs.

 

 

 

 

 

 

 

 

 

9. Understand the features of the Microprocessor.

 

9.1 Define Microprocessor.

9.2 List 8-bit, 16-bit, 32 bit and 64-bit Microprocessors.

9.3 Describe the architecture of the 8085 microprocessor.

9.4 Describe the pin diagram and function of each pin of Intel 8085 microprocessors.

9.5 Describe the registers of Intel 8085 microprocessors.

9.6 Describe the block diagram of a microcomputer.

9.7 Differentiate between microprocessors and microcomputers.

 

 

10. Understand the Programming of 8085 Microprocessors.

 

10.1 Describe the instruction set of 8085 microprocessors.

10.2 Explain the addressing modes of Intel 8085 microprocessors.

10.3 Mention the simple programs using 8085 instructions.

 

 

11. Understand the 8085 Microprocessors system.

 

11.1 Define Bus multiplexing.

11.2 Explain the process of multiplexing the AD7 -AD0 bus using a latch.

11.3 Describe the technique of generating control signals.

11.4 Mention the function of interrupt controls and serial I/O controls.

11.5 Differentiate between memories mapped I/O and standard I/O.

11.6 Discuss the function of programmable peripheral Interface (PPI), programmable DMA controller and programmable interrupt controller (PIC).

11.7 Discuss the function of the Programmable Interval Timer and Programmable Communication Interface.

11.8 Draw an 8085 based microcomputer system.

 

12. Understand the features of 16-bit Microprocessors.

 

12.1 Describe the architecture of the 8086 microprocessor.

12.2 Describe the pin diagram and function of each pin of Intel 8086 microprocessors.

12.3 Describe the registers of Intel 8086 microprocessors.

12.4 Explain the addressing modes of the Intel 8086 microprocessors.

12.5 Mention the simple programs using the 8086 instructions.

 

 

 

 

 

 

PRACTICAL:

 

1. Verify the truth tables of logic gates (OR, AND, NOT, NAND & NOR)

1.1 Select logic gate ICs.

1.2 Select appropriate circuits, required tools, equipment’s and materials.

1.3 Insert the selected IC into the Breadboard.

1.4 Connect the circuits as per the diagram on the trainer board.

1.5 Switch on the DC power supply,

1.6 Verify the truth tables.

 

2. Show the operation of NAND & NOR gate as universal gates.

 

2.1 Select logic gate IC of NAND gate & NOR gate.

2.2 Select appropriate circuits, required tools, equipment’s and materials.

2.3 Insert the selected IC into the Breadboard.

2.4 Connect the circuits as per diagram for AND OR & NOT gate on trainer board.

2.5 Switch on the DC power supply,

2.6 Verify the truth tables of AND OR & NOT gate operation.

 

3. Verify the functions of half adder & half subtractor.

 

3.1 Select ICs.

3.2 Draw the pin diagram and internal connection.

3.3 Draw appropriate circuits.

3.4 Select required tools, equipment’s and materials.

3.5 Connect the circuits as per the diagram on the trainer board.

3.6 Switch on the DC power supply,

3.7 Verify the truth tables.

 

4. Verify the functions of full adder & full subtractor.

 

4.1 Select ICs.

4.2 Draw the pin diagram and internal connection.

4.3 Draw appropriate circuits.

4.4 Select required tools, equipment’s and materials.

4.5 Connect the circuits as per the diagram on the trainer board.

4.6 Switch on the DC power supply.

4.7 Verify the truth tables.

 

 

 

 

 

5. Verify the truth table of different J-K flip-flops.

 

5.1 Select appropriate ICs.

5.2 Draw the pin diagram and internal connection.

5.3 Draw appropriate circuits.

5.4 Select required tools, equipment’s and materials.

5.5 Connect the circuits as per the diagram on the trainer board.

5.6 Switch on the DC power supply.

5.7 Verify the truth tables.

 

 

 

6. Verify the operation of the Shift register.

 

6.1 Select a SIPO shift register IC.

6.2 Connect the SIPO shift register circuits on Digital Trainer Board.

6.3 Apply clock input pulse to the circuit and observe the operation.

6.4 Select a PISO shift register IC.

6.5 Connect the PISO shift register circuits on Digital Trainer Board.

6.6 Apply clock input pulse to the circuit and observe the operation.

 

7. Verify the operation of the Binary counter.

 

7.1 Select 4-Bit ripple counter IC.

7.2 Connect the Up/Down ripple counter circuit on Digital Trainer Board

7.3 Apply clock input pulse to the circuit and observe the operation of up-counting and down counting.

7.4 Select MOD-10 counter IC.

7.5 Connect the Decade counter circuit on Digital Trainer Board.

7.6 Apply clock input pulse to the circuit and observe the Decade operation.

 

8. Verify the operation of D/A converter.

 

8.1 Select a D/A converter IC.

8.2 Connect a ladder R/2R D/A converter circuit on Digital Trainer Board.

8.3 Apply input data and clock pulses to the different inputs of the circuit.

8.4 Observe the operation of the circuit and detect the output result of the D/A converter

 

9. Verify the operation of the A/D converter.

 

9.1 Select an A/D converter IC.

9.2 Connect a 3-bit parallel A/D converter circuit on Digital Trainer Board.

9.3 Apply input data and clock pulses to the different inputs of the circuit.

9.4 Observe the operation of the circuit and detect the output result of the A/D converter.

 

10. Verify the operation of SRAM & DRAM.

 

10.1 Select an SRAM IC.

10.2 Connect Static RAM circuit on Digital Trainer Board.

10.3 Apply input data and clock pulse to the circuit.

10.4 Observe the operation of the circuit and stored memory data in the SRAM.

10.5 Select a DRAM IC.

10.6 Connect Dynamic RAM circuit on Digital Trainer Board.

10.7 Apply input data and clock pulse to the circuit.

10.8 Observe the operation of the circuit and stored memory data in the DRAM.

 

11. Verify the operation of an EPROM.

 

11.1 Select an EPROM IC.

11.2 Connect EPROM circuit on Digital Trainer Board.

11.3 Apply input data and clock pulse to the circuit.

11.4 Observe the operation of the circuit and stored memory data into the EPROM.

 

 

 

12. Verify the operation of 8085 Microprocessor.

 

12.1 Select 8085 microprocessor trainer board.

12.2 Solve simple arithmetic & logical problems.

12.3 Monitor the result into the Matrix display/LCD display.

12.4 Solve simple I/O problems.

GPA Calculator

Definition: GPA (Grade Point Average) is a standardized way of measuring academic achievement in many educational systems around the world. ...