Anda di halaman 1dari 37

SFE3013 BASIC ELECTRONICS

- DIGITAL ELECTRONICS NUMERATION SYSTEMS (Numbers and Coding Systems)

DIGITAL ELECTRONICS CHAPTER OUTLINE 1. Analog and Digital Signals 2. Numbers and Coding Systems 3. Logic Gates 4. Combining Logic gates 5. Simplifying Logic gates 6. Flip-Flops

1. Differentiate between analog and digital signals. 2. Convert numbers between the number systems.

Numerical Presentation The quantities that are to be measured, monitored, recorded, processed and controlled are analog and digital, depending on the type of system used. There are basically two ways of representing the numerical value of quantities: analog and digital.

1. Analog and Digital Signals


Digital circuits are electric circuits based on a number of discrete voltage levels. Digital circuits are the most common physical representation of Boolean algebra and are the basis of all digital computers. To most engineers, the terms "digital circuit", "digital system" and "logic" are interchangeable in the context of digital circuits.

Most digital circuits use two voltage levels labeled "Low"(0) and "High"(1). Computers, electronic clocks, and programmable logic controllers (used to control industrial processes) are constructed of digital circuits.

Advantages signals represented digitally can be transmitted without degradation due to noise. For example, a continuous audio signal, transmitted as a sequence of 1s and 0s, can be reconstructed without error provided the noise picked up in transmission is not enough to prevent identification of the 1s and 0s. An hour of music can be stored on a compact disc as about 6 billion binary digits.

Advantages In a digital system, a more precise representation of a signal can be obtained by using more binary digits to represent it. Information storage can be easier in digital systems than in analog ones. The noise-immunity of digital systems permits data to be stored and retrieved without degradation.

In an analog system, additional resolution requires fundamental improvements in the linearity and noise characteristics of each step of the signal chain. In an analog system, noise from aging and wear degrade the information stored. In a digital system, as long as the total noise is below a certain level, the information can be recovered perfectly.

ANALOG vs DIGITAL

In analog representation a quantity is represented by a voltage, current, or meter movement that is proportional to the value of that quantity --> CONTINUOS VALUE In digital representation the quantities are represented not by proportional quantities but by symbols called digits. --> 0 or 1 --> DISCRETE VALUE

ANALOG

DIGITAL

In digital circuits, a logic level is one of a finite number of states that a signal can have. Logic levels are usually represented by the voltage difference between the signal and ground. The range of voltage levels that represents each state depends on the logic family being used. The two levels are logical high and logical low, which generally correspond to a binary 1 and 0 respectively.

Examples of binary logic levels:


Technology CMOS L voltage 0V to VCC/2 H voltage VCC/2 to VCC Notes VCC = supply voltage VCC = 5V 10% VEE is about 5.2V; VCC=Ground

TTL

0V to 0.8V

2V to VCC

ECL

VEE to 1.4V

1.2V to 0V

2. NUMBERS and CODING SYSTEMS A number system is a code that uses symbols to refer to a number of items. Decimal, binary, hexadecimal (HEX), octal, binary coded decimal (BCD), Gray code, ASCII code.

2. NUMBERS and CODING SYSTEMS The Decimal system is a base-ten system 0,1,2,3,4,5,6,7,8,9. The binary system is a base-two system. 0 and 1 The octal system is a base-eight system. 0,1,2,3,4,5,6,7.

The Hexadecimal system is a base-sixteen system. 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. The position of a digit indicates its weight, or value within the number. The weights are based on powers of .. n 10 in a decimal number (10 ) 2 in a binary number (2 ) 8 in a octal number (8 )
n n n

16 in a Hex number (16 ) Where n is a digit position. n = -2, -1, 0, 1, 2, ..

Decimal System Weight

Binary System weight


The position of each digit (bit) in a binary number can be assigned a weight

22 21 20 1 0 1 1 .

2-1 2-2 2-3 1 0 1

OCTAL and HEX

Binary is also easily converted to the octal numeral system, since octal uses a radix of 8
Octal 0 1 2 3 4 5 6 7 Binary 000 001 010 011 100 101 110 111

Example: Converting from (a) octal to binary 658 = 110 1012 178 = 001 1112 (b) binary to octal: 1011002 = 101 1002 grouped = 548 100112 = 010 0112 grouped with padding = 238 octal to decimal: 658 = (6 81) + (5 80) = (6 8) + (5 1) = 5310 1278 = (1 82) + (2 81) + (7 80) = (1 64) + (2 8) + (7 1) = 8710

(c)

decimal to binary conversion


A systematic method of converting whole numbers from decimal to binary is the repeated division-by-2 process.

BINARY TO DECIMAL CONVERSION

Conversion Code - Chart


DECIMAL 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

HEX

BINARY

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

1111

http://easycalculation.com/hex-converter.php

Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

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

Octal 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17

Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111

Question 1:
Counting practice: count from zero to thirty-one in binary, octal, and hexadecimal:

Convert decimal 54 to binary number


54 /2 = 27 27 /2 = 13 13 /2 = 6 6 /2 = 3 3 /2 = 1 1 /2 = 0 Remainder = 0 Remainder = 1 Remainder = 1 Remainder = 0 Remainder = 1 Remainder = 1

ANSWER: 5410 = 1101102

BINARY TO OCTAL CONVERSION Convert 10110111.12 to octal Solution: Each octal digit can be translated from the 3-bit binary groups. Answer: 10110111.12 = 267.48

BINARY TO HEXADECIMAL CONVERSION Convert 10110111.12 to hexadecimal Solution: Group the bits in four's, from the binary point left, and from the binary point right, adding zeros as necessary to make complete 4-bit groups. Answer: 10110111.12 = B7.816

HEXADECIMAL TO BINARY CONVERSION Convert C316 to binary number Solution: Each HEX digit is converted to its 4-bit binary equivalent. C16 = 11002 316 = 00112

Answer: C316 = 110000112

Exercise 4 Convert the number 1128 DECIMAL to HEXADECIMAL


Ans:

46816
Ans:

Convert octal 32 to binary Convert octal 53.7 to binary

011010

Binary Addition
The four basic rules for adding binary digits (bits) are as follows: 0 + 0 = 0 Sum of 0 with a carry of 0 0 + 1 = 1 Sum of 1 with a carry of 0 1 + 0 = 1 Sum of 1 with a carry of 0 1 + 1 = 0 Sum of 0 with a carry of 1 [Excercise] Add 1111 and 1100.
Ans:

11011

Bit Grouping Name 4-bit 8-bit 16-bit 32-bit Nibble Byte Word Double word

ASCII CODE
The ASCII (pronounced ask-E) code assigns binary patterns for Numbers 0 to 9 All the letters of English alphabet, uppercase and lowercase Many control codes and punctuation marks The ASCII system uses 7 bits to represent each code
Hex 5A 59 ... 44 43 42 41 Symbol Z Y ... D C B A Hex 7A 79 ... 64 63 62 61 Symbol z y d c b a

HOMEWORK Perform hex subtraction: 59F 2B8

THE END

Anda mungkin juga menyukai