[go: up one dir, main page]

0% found this document useful (0 votes)
27 views13 pages

Systems, Numeric Codes, and Conversions

This document covers the fundamentals of logic circuits, focusing on numerical systems, including decimal, binary, octal, and hexadecimal systems, along with their conversions. It explains how digital devices handle discrete elements of information represented by binary signals and details procedures for converting between different numerical bases. Additionally, it introduces various coding systems used to represent information, such as numeric and alphanumeric codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views13 pages

Systems, Numeric Codes, and Conversions

This document covers the fundamentals of logic circuits, focusing on numerical systems, including decimal, binary, octal, and hexadecimal systems, along with their conversions. It explains how digital devices handle discrete elements of information represented by binary signals and details procedures for converting between different numerical bases. Additionally, it introduces various coding systems used to represent information, such as numeric and alphanumeric codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

1 Systems, numerical codes and conversions


Digital devices (telephone switches, voltmeters, machines
calculators, etc.), handle discrete elements of information. Such elements
they can be electrical impulses, the decimal digits, the letters of the alphabet, the
arithmetic operations or any other set of meaningful symbols.

Discrete elements of information are represented in a digital system by


physical quantities, called signals (voltages and currents). Digital systems
Electronics have only two discrete values and they are called binary.

A digital computer manipulates discrete elements of information and these elements


they are represented in binary form. The operands used in the calculations can be
expressed in the binary number system. Other discrete elements, including the
decimal digits are represented with binary codes. Data processing is
it is carried out through binary logical elements, using binary signals.

To understand a binary system, it is necessary to start from the numeric system.


decimal.

1.1 Numeric systems


1.1.1 Decimal number system

This system is based on the following digits:


0, 1, 2, 3, 4, 5, 6, 7, 8, y, 9.The position of the digits in the base 10 system determines
the magnitude of the number read. The example is indicated below:

( 0)
623 =6x10 +2 )2x10
( +3x10
1) (
623 = 6 hundreds + 2 tens + 3 units

A general expression for any number in a base R system is:

page 1
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

= +⋯+ 3+ 2+ 1+ 0+ −1+ −2+ ⋯


3 2 1 0 −1 −2

+ −

Ec.1

Where:

: ú
: í ó
: í
:

1.1.2 Binary number system

The binary system (base 2) only has the digits 0 and 1.Table1.1mour
0000

Table 1.1 Representation of decimals in binary

DECIMALBINARY
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001

The major use of the binary system (mainly in computers) comes from the
simplicity of the basic digits 0 and 1. Since there are only two digits, it is possible to
represent in a computer by a switch: ON state or on (1) or OFF
the off (0).
1.1.3 Octal number system

The octal or base 8 number system is very common because it converts


easily to binary. The root is the number 8 and the digits go from 0 to 7.

page 2
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

1.1.4 Hexadecimal Number System

The hexadecimal number system (base 16) is used in most of the


computers. Using the commonly adopted IBM terminology, these digits are
they are represented as indicated in Table 1.2.

Table 1.2 Representation of decimals in hexadecimal

DECIMALHEXADECIMAL
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F

1.2 Conversion between numerical systems


1.2.1 Conversion of integers from any base to decimal

Procedure:

• Each digit (from any base) is multiplied by the power it occupies.


of the quantity.
• A sum of the results of the previous multiplications is obtained.

page 3
UNIT 1 FUNDAMENTALS OF LOGICAL CIRCUITS

Example 1: convert the binary number101102a decimal

10= 1x24+ 0x23+ 1x22+ 1x21+ 0x20


10= 16 + 0 + 4 + 2 + 0
10= 2210

Example 2: convert the octal number243078a decimal

10= 2x84+ 4x83+ 3x82+ 0x81+ 7x80


10= 8192 + 2048 + 192 + 0 + 7
10= 1043910

Example 3: convert the hexadecimal number257016a decimal

10= 2x163+ 5x162+ 7x161+ 0x160


10= 8192 + 1280 + 112 + 0
10= 958410

1.2.2 Conversion of integers from decimal to any base

Procedure:

• The whole decimal number is divided by the base to convert and the remainder
it will be the least significant digit of the sought amount.
• The quotient is divided as many times as necessary until it becomes
to zero, the resulting remainders of each division will be the following digits
of the sought amount.
• The process must stop when the quotient becomes zero for
thus the last remainder will be the most significant digit.

page 4
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

Example 4: Convert the decimal number 5610 to binary

56 2
28 0 LSB
14 0

7 0
3 1
1 1
0 1MSB

Therefore:
5610=1110002

Example 5: Convert the decimal number 958410 to octal

9584 8
1198 0 LSB
149 6
18 5
2 2
0 2 MSB

Therefore:
225608

Example 6: Convert the decimal number 968416 to hexadecimal

9684 16
605 4 LSB
37 D
2 5
0 2MSB

page 5
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

Therefore:
968410= 25D416

1.2.3 Conversion of fractional numbers from any base to decimal

Procedure:

• Each digit is multiplied by the base raised to the negative power that it has.
occupying the digit within the amount.
• A summation of the results of the previous multiplications is made.

Example 7: convert the binary number 0.011001 to decimal

N10 = 0x2-1+ 1x2 +-21x2 + 0x2


-3 -4
+ 0x2 + 1x2-5 -6
N10 = 0.25 + 0.125 + 0.015625
0.39062510
Example 8: convert the octal number 0.3006158 to decimal

N10= 3x8-1+ 0x8 +-20x8 + 6x8


-3
+ 1x8-4+ 5x8 -5 6
N10= 0.375+0.001464+0.000030+0.000019
0.37651310
Example 9: convert the hexadecimal number 0.606C216a to decimal

6*16 + 0*16-1+ 6*16 +-2C*16 + 2*16


-3 -4 -5
N10= 0.375 + 0.0014648 + 0.0001831 + 0.0000019
N10= 0.376649810

1.2.4 Conversion of fractional numbers from decimal to any base

Procedure:
• The decimal fraction is multiplied by the base and the resulting integer will be the
digit that will comprise the sought fractional amount being the
First integer found the most significant digit.
• The process should be stopped when the fraction becomes 0 or when
a minimum of 0 successive multiplications is reached.

page 6
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

Example 10: convert the decimal number 0.376510 to binary

0.3765 x2
0.7530 x2
1.5060 x2
1.0120 x2
0.0240 x2
0.0480 x2
0.0960 x2
0.1920 x2
0.3840 x2
0.7680 x2
1.5360

For lo 0.376510 = 0.01100000012

Example 11: convert the decimal number 0.374510 to octal

0.3745 x8
2.9960 x8 Therefore: 0.374510 = 0.27757473318
7.9680 x8
7.7440 x8
5.9520 x8
7.6160 x8
4.9280 x8
7.4240 x8
3.3920 x8
3.1360 x8
1.0880

page 7
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

Example 12: convert the decimal number 0.448710 to hexadecimal

0.4487 x16
7.1792 x16 Therefore: 0.448710 = 0.72DE00D1B716
2.8672 x16
D.8752 x16
E.0032 x16
0.0512 x16
0.8192 x16
D.1072 x16
1.7152 x16
B.4432 x16
7.0912

1.2.5 Conversion of binary numbers to octal base

Procedure:

• The conversion from binary to octal is easily carried out by partitioning.


from the binary number in groups of three digits each starting from the
binary point doing it from right to left for whole numbers and
left to right for fractional numbers.
• The corresponding octal digit is assigned to each group.

Example 13: convert the binary number 10110001101011 to octal

10 110 001 101 0112 therefore:


2 6 1 5 38 101100011010112= 261538

Example 14: convert the binary number 0.1111000001102 to octal

0. 111 100 000 1102 therefore:


0. 7 4 0 68 0.1111000001102 2= 0.74068

p. 8
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

1.2.6 Conversion of octal numbers to binary base

Procedure:

• The conversion from octal to binary is done by a procedure opposite to the


made in the conversion from binary to octal.
• Each octal digit is converted to a 3-digit binary equivalent.

Example 15: convert the octal number 673.124 to binary

6 7 3 . 1 2 48 therefore:
110 111 011 . 001 010 1002 673.1248 = 110111011.0010101002

1.2.7 Conversion of binary numbers to hexadecimal base

Procedure:

• It is similar to the conversion from binary to octal, except that the number is divided.
in groups of four digits.

Example 16: convert the binary number 10110001101011.1111001001011010 to


hexadecimal

10 1100 0110 1011 1111 0010 0101 10102


2 C 6 B. F 2 5 A16
Therefore: 10110001101011.11110010010110102 = 2C6B.F25A16

1.2.8 Conversion of hexadecimal numbers to binary base

Procedure:

• It is identical to the conversion from octal to binary except that the binary number
it is divided into groups of four digits.
Example 17: convert the hexadecimal number 606.D1AC16 to binary

page 9
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

6 0 6 . D 1 A C16
010 0000 0110. 1101 0001 1001 11002

therefore: 606.D1AC16= 01100000 0110.11010001 100111002

1.2.9 Conversion of octal numbers to hexadecimal base

Procedure:

• The given octal number is converted to binary.


• The obtained binary number is divided into groups of four digits and these into
its hexadecimal equivalence.
Example 18: convert the octal number 365.6428 to hexadecimal

3 6 5 . 6 4 28 therefore:
011 110 101 . 011 100 0102 365.6428 = F5.D116
0 1111 0101 . 1101 0001 02
F 5 . D 116

1.2.10 Conversion of hexadecimal numbers to octal base

Procedure:

• The conversion from hexadecimal to octal is similar to the conversion from octal to
hexadecimal, what changes is the partition of the hexadecimal number in
binary in groups of 3 digits.

Example 19: convert the hexadecimal number CAFE.0CA16a to octal

C A F E . 0 C A16
1100 1010 1111 1110 . 0000 1100 10102
1 100 101 011 111 110 . 000 011 0010102
1 4 5 3 7 6 . 0 3 1 28
Therefore: CAFE.0CA16= 145376.03128

page 10
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

1.3 Codes

A code is a set of bits arranged according to a unique model and is


used to represent specific information. The encoding of information is
a means of specifying characters (numeric or alphabetic), using others
symbols.

Codes can be divided into:

1. Numeric codes
Alphanumeric codes
3. Error detection codes

Numerical Codes

They are those that allow us to represent a decimal number through a group.
of bits. They can be classified as follows, see theTable1.3:

1. BCD: Binary Coded Decimal, each decimal digit is represented


for its equivalent in binary in groups of 4 bits.

2. Excess 3, Ex3, in this code, each decimal digit is added or


three is added to it and then each of these new digits is
convert to its binary equivalent in groups of four bits.

3. 8 4 -2 -1: it is a code of positive and negative load, take each digit


as a group of 4 bits.

4. Biquinary or biguinario is a code of positive load, it takes each


I digit as two groups of two and five bits respectively.

5. Ring counter, in this code it only holds a '1', in each


a ten-bit encoded group, according to the position of the bit '1', is
the value that corresponds in decimal.

page 11
UNIT 1 FUNDAMENTALS OF LOGICAL CIRCUITS

Table 1.3 represents the numeric codes that were listed.

Table 1.3 Representation of numerical codes

Digit BCD EX-3 8 4 - - Biquinary Ring counter


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

1.4 Error detection and correction codes


1.4.1 Gray Code

It is an unweighted code, that is to say, there is no relationship between the

position of a bit and its binary weight.

Steps for converting binary to Gray code:

The first bit of the gray code is equal to the first binary bit, the first bit remains
to the left.
2. The bits of the binary number are compared in pairs (the 1st with the 2nd, and the 2nd with the

3°, etc), if both bits are the same the result is 0, if they are different it is 1.
Step 2 is repeated until the conversion is complete.

Example: encode the binary number 1101112 in gray code

Binary 1101112
Gray 101100

page 12
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS

Steps to convert Gray code to binary:

The first gray bit will give rise to the first binary bit, the first bit is at the
left.
If the second gray bit is 0, the second binary bit will be equal to the first.
binary digit. If the second gray bit is 1, then the second binary bit
it will be the inverse of the first binary bit.

3. If the third gray bit is 0, the third binary bit will be equal to the second digit.
binary. If the third gray bit is 1, then the third binary bit will be the opposite of
second binary bit... and so on until finished.

Example: encode the gray number 101100 in binary code

Gray 101100
Binary 110111

page 13

You might also like