Presentation is loading. Please wait.

Presentation is loading. Please wait.

CUIT105: Logic Design and Switching Circuits

Similar presentations


Presentation on theme: "CUIT105: Logic Design and Switching Circuits"— Presentation transcript:

1 CUIT105: Logic Design and Switching Circuits
Digital Number System Level: Date: Student Name: Mercy Chinyuku Student Number: C J

2 Presentation Layout Lesson Objectives Introduction Numbering systems
Why Use Hexadecimal System in Computing Questions Conclusion References Lecture Evaluation

3 Lesson Objectives At the end of the lecture the student should be able to: Recognize the basic characteristics of the decimal, binary system, Octal and hexadecimal systems. Convert a number from one number system to another number system. Count in the hexadecimal systems. understand the advantages of using the hexadecimal number system in computing.

4 Introduction Today digital technology plays an important role in our lives. We are assisted by digital devices to carry about our daily normal business at home or college. *Digital devices are constructed from electronic components that are stable in two states. Hence its easier to represent these states using binary numbering system. The most common numbering systems are the decimal, binary, octal, and hexadecimal. * e.g. a capacitors, diodes, resistors, LEDs, transistors,

5 Decimal System The decimal system is clearly the most familiar to us because it is a tool that we use every day. The decimal system is composed of 10 numerals or symbols. These 10 symbols are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; using these symbols as digits of a number, we can express any quantity. The word digit is derived from the Latin word for “finger.” The decimal system, also called the base-10 system because it has 10 digits, has evolved naturally as a result of the fact that people have 10 fingers. ( 45310)

6 Decimal System ctd The decimal system is a positional-value system in which the value of a digit depends on its position. For example, consider the decimal number The digit 4 represents 4 hundreds, the 5 represents 5 tens, and the 3 represents 3 units. The 4 carries the most weight of the three digits; it is referred to as the most significant digit (MSD). The 3 carries the least weight and is called the least significant digit (LSD).

7 Decimal System ctd Consider this decimal example; 27.3510.
This number is equal to 2 tens plus 7 units plus 3 tenths plus 5 hundredths, or (2 ×101)+(7×100) (3×10-1)+(5×10-2 ) The decimal point is used to separate the integer and fractional parts of the number.

8 Decimal System ctd The various positions relative to the decimal point carry weights that can be expressed as powers of 10. The number is represented. The decimal point separates the positive powers of 10 from the negative powers. The number is thus equal to

9 Decimal System ctd Decimal Position Values as powers of 10
Represent as powers of 10

10 Binary Numbering System
All computers use the binary numbering system. The binary system is composed of 2 numerals or symbols. These 2 symbols are 0 and 1; using these symbols as digits of a number, we can express any quantity. The 0 and 1 are called binary digits (BIT). *The two digits can represent any two states of an electronic circuit. (on or off) The binary system, also called the base-2 system * Give an example of an electric circuits with a switch and light

11 Binary System ctd The binary system is a positional-value system
For example, consider the binary number 1010. The 1st digit represents 1 × 23, the next 0 represents 0× 22, the next 1 represents 1 × 21 and the last zero represents 0× 20 The first 1 carries the most weight of the 4 bits; it is referred to as the most significant bit (MSB). The last bit a carries the least weight and is called the least significant bit (LSB).

12 Binary System ctd The various positions relative to the binary point carry weights that can be expressed as powers of 2. Consider this binary example; 11.01 This number is equal (1×21)+(1×20)+(0×2-1)+(1×2-2 )

13 BINARY-TO-DECIMAL CONVERSIONS
Any binary number can be converted to its decimal equivalent simply by summing together the weights of the various positions in the binary number that contain a 1. convert to its decimal equivalent.

14 BINARY-TO-DECIMAL CONVERSIONS ctd
The procedure is to find the weights (i.e., powers of 2) for each bit position that contains a 1, and then to add them up.

15 DECIMAL-TO-BINARY CONVERSIONS
There are two ways to convert a decimal whole number to its equivalent binary-system representation. Positional weight system Repeated division system

16 Positional weight system
The decimal number is expressed as a sum of powers of 2, and then 1s and 0s are written in the appropriate bit positions. Convert to binary number Note that a 0 is placed in the 21 and 24 positions, since all positions must be accounted for

17 Repeated Division Another method for converting decimal integers uses repeated division by 2. The conversion, illustrated for 2510, requires repeatedly dividing the decimal number by 2 and writing down the remainder after each division until a quotient of 0 is obtained. Note that the binary result is obtained by writing the first remainder as the LSB and the last remainder as the MSB.

18

19 Conversion of decimal fraction to binary fraction
Instead of division, multiplication by 2 is carried out and the integer part of the result is saved and placed after the decimal point. The fractional part is again multiplied by 2 and the process repeated. Example: convert to binary fraction. 0.68 * 2 = 1.36 integer part is 1 0.36 * 2 = 0.72 integer part is 0 0.72 * 2 = 1.44 integer part is 1 0.44 * 2 = 0.88 integer part is 0 Answer = …..

20 Example : Convert decimal number 24.6 to a binary equivalent?
Solution. Step 1: Separate out integer and fraction part Integer part= 24 Fractional part= 0.6 Step 2: Find equivalent binary number for integer part Binary equivalent for integer part =(11000)2 Step 3: Find equivalent binary number for fractional part Binary equivalent = This number is an approximation of decimal 24.6 , because we have terminated the conversion of fraction part after 5 digits .

21 Octal Numbering System
All computers store data as bits group of 8 bits known as a byte. The Octal system is composed of 8 numerals or symbols. These 8 symbols are 0,1,2,3,4,5,6,7; using these symbols as digits of a number, we can express any quantity. The Octal system, also called the base-8 system * Give an example of an electric circuits with a switch and light

22 Octal System ctd The Octal system is a positional-value system
For example, consider the binary number The 1st 4 digit represents 4 × 82, the second digit 3 represents 3× 81, the next digit 7 represents 7 × 80 and for the fractional part 3 represent 3×8-1 and 2×8-2 The number can be expressed as (4×82 ) +( 3× 81)+(7 × 80) +(3×8-1 )+ (2×8-2) The first 4 digit carries the most weight it is referred to as the most significant digit (MSD). The last bit a carries the least weight and is called the least significant digit (LSD).

23 Octal to Decimal Find the weights (i.e., powers of 8) for each digit position and then to add them up. 3458 = (3×82)+(4×81)+(5×80)=(3×64)+(4×8)+(5×1) 

24 Decimal to Octal repeated division by 8 method is used.
Example convert 3510 to octal Solution: 38 /8 = 4 remainder 6 4/8 = 0 remainder 4 Answer = 46

25 Binary to Octal An easy way to convert from binary to octal is to group binary digits into sets of three, starting with the least significant (rightmost) digits. Binary: = Pad the most significant digits with zeros if necessary to complete a group of three.

26 Binary to Octal ctd Binary =011 100 101 Octal = 3 4 58 3458
Then, look up each group in a table: Binary = Octal  = 3458

27 Octal to Binary Converting from octal to binary is as easy as converting from binary to octal. Simply look up each octal digit to obtain the equivalent group of three binary digits.

28 Octal to Binary ctd Octal  = Binary = =

29 HEXADECIMAL NUMBER SYSTEM
The hexadecimal number system uses base 16. Thus, it has 16 possible digit symbols. It uses the digits 0 through 9 plus the letters A, B, C, D, E, and F as the 16 digit symbols. The digit positions are weighted as powers of 16 , rather than as powers of 10 as in the decimal system.

30 HEXADECIMAL NUMBER SYSTEM ctd

31 HEXADECIMAL NUMBER SYSTEM ctd
Note that each hexadecimal digit represents a group of four binary digits. It is important to remember that hex (abbreviation for “hexadecimal”) digits A through F are equivalent to the decimal values 10 through 15.

32 The table shows the relationships among hexadecimal, decimal, and binary.

33 Hex-to-Decimal Conversion
A hex number can be converted to its decimal equivalent by using the fact that each hex digit position has a weight that is a power of 16. The LSD has a weight of 160=1, the next higher digit position has a weight of 161 =16, the next has a weight of 162 =256 and so on.

34 Hex-to-Decimal Conversion ctd

35 Decimal-to-Hex Conversion
Decimal-to-hex conversion can be done using repeated division by 16

36 Decimal-to-Hex Conversion ctd

37 Decimal-to-Hex Conversion ctd
Convert to Hex

38 Decimal-to-Hex Conversion ctd
Note that the remainders of the division processes form the digits of the hex number. Note that any remainders that are greater than 9 are represented by the letters A through F.

39 Hex-to-Binary Conversion
The hexadecimal number system is used primarily as a “shorthand” method for representing binary numbers. Each hex digit is converted to its four-bit binary equivalent

40 Hex-to-Binary Conversion ctd

41 Hex-to-Binary Conversion ctd

42 Binary-to-Hex Conversion
Conversion from binary to hex is just the reverse of the process . The binary number is grouped into groups of four bits, and each group is converted to its equivalent hex digit. Zeros (shown shaded) are added, as needed, to complete a four-bit group.

43 Binary-to-Hex Conversion ctd

44 Please Note!!!! To perform these conversions between hex and binary, it is necessary to know the four-bit binary numbers (0000 through 1111) and their equivalent hex digits. Once these are mastered, the conversions can be performed quickly without the need for any calculations. This is why hex is so useful in representing large binary numbers.

45 Counting in Hexadecimal
When counting in hex, each digit position can be incremented (increased by 1) from 0 to F. Once a digit position reaches the value F, it is reset to 0, and the next digit position is incremented. 39, 3A, 3B, 3C, 3D, 3E, 3F, 40, 41, 42 6F8, 6F9, 6FA, 6FB, 6FC, 6FD, 6FE, 6FF, 700

46 Counting in Hexadecimal ctd
Note that when there is a 9 in a digit position, it becomes an A when it is incremented. With N hex digit positions, we can count from decimal 0 to for a total of 16N -1 different value. For example, with three hex digits, we can count from to FFF16, which is 010 to , for a total of 4096 = 163 different values Question 00-ff 256 different values

47 Why Hex in computing? Hex is often used in a digital system as sort of a “shorthand” way to represent strings of bits. In computer work, strings as long as 64 bits are not uncommon. These binary strings do not always represent a numerical value, but—as you will find out—can be some type of code that conveys non-numerical information.

48 Usefulness of Hex ctd When dealing with a large number of bits, it is more convenient and less error-prone to write the binary numbers in hex and, It is relatively easy to convert back and forth between binary and hex.

49 Usefulness of Hex ctd It is important to keep in mind, though, that digital circuits all work in binary. Hex is simply used as a convenience for the humans involved. You should know the 4-bit binary pattern for each hexadecimal digit. Only then will you realize the usefulness of this tool in digital systems.

50 Questions Convert the following binary number to decimal, octal, Hex
10011 Convert to its decimal equivalent. What is the weight of the MSB of a 16-bit number? Convert 8310 to 8-bit binary using both methods. Convert to binary using both methods. Check your answer by converting back to decimal. Convert decimal number 0.95 to its binary, Octal , hex equivalent? Convert 24CE16 to decimal. Convert to hex, then from hex to binary. Convert to hex. Write the next four numbers in this hex counting sequence: E9A, E9B, E9C, E9D, _____, _____, _____, _____. Convert to binary16. Work in pairs

51 Conclusion There are four major numbering systems that are in use.
Binary systems is computer readable, data is stored as bits, Bits are the smallest unit for computer storage An octal number represented with 8-bits is known as a byte which is the basic unit for measuring computer memory Instead of using binary its easier to use Hex system which is easily understood by Human. Decimal system is the natural numbering system for humans.

52 References Chen, W.-K. & al, e., Logic Design. 1st ed. Florida: CRC Press. Mano, M.M. & Giletti, M.D., Digital Design with an Introduction to Verilog HDL. 5th ed. New Jersey: Pearson International. Tocci, R.J., Widmer, N.S. & Moss, G.L., Digital Systems: Principles and Applications. 11th ed. London: Pearson Education.

53 Lecture evaluation General Comments Individual Comments


Download ppt "CUIT105: Logic Design and Switching Circuits"

Similar presentations


Ads by Google