Chapter 1 Preliminaries

Size: px
Start display at page:

Download "Chapter 1 Preliminaries"

Transcription

1 Chapter 1 Preliminaries This chapter discusses the major classes of programming languages and the relationship among them. It also discusses the binary and the hexadecimal number systems which are used in most computer systems, including computer systems based on the Intel X-86 processors. 1.1 Classes of Programming Languages A programmer instructs a computer to perform a task or to solve a problem by specifying the step-by-step operations that the computer must execute in order to perform that task, or to solve that problem. The specification of these step-by-step operations is done in a programming language, and is referred to as a program. In general, a programming language belongs to one of the two major classes of programming language, High-level languages and Low-level languages. Examples of high-level languages are Pascal, PL/1, C/C++, BASIC, FORTRAN, COBOL, Java,..., etc. Low-level languages are machine languages and their corresponding assembly languages. Machine Languages A machine language program consists of instructions and data represented as sequences of binary digits (or bits), 0's and 1's. 1

2 2 A machine language instruction specifies a fundamental operation that the computer is capable of carrying out. It consists in general of two major parts: the operation code and the operand as illustrated in section a of Figure 1.1. The operation code also referred to as opcode, specifies the operation to be carried out by the computer, and the operand specifies the data, or the location (inside of the computer) of the data on which the operation is to be carried out. Figure 1.1 Machine/Assembly language Instruction a) Machine language Instruction General Format Opcode Operand b) Intel 8086 Processor Machine/Assembly Language Instruction 1. Instruction in binary: Instruction in hexadecimal: 83 C Instruction in assembly language: SUB DX, 7 Each type of computer has a collection of machine language instructions called instruction set. The instruction set of a computer is referred to as its machine language and depends on the computer s processor. Two different types of computer have different instruction sets, and a program is executed by a computer only if it is written in its machine language. For example, a program written for the IBM PC and compatible computers can not be executed by an Apple Macintosh computer. An instruction for the IBM PC and compatible computers is provided in part1 of section b) of Figure 1.1. The opcode of this instruction is , and its operand is It says to subtract the integer value 7 from the integer value in register DX, and to place the result of the operation back into register DX.

3 It is difficult for most humans to process instructions and data specified in binary because of their length and the many possibilities to make mistakes: for these reasons, machine language instructions and data are often specified in hexadecimal (base 16) or octal (base 8) number systems. These number systems provide more compact ways to write binary information. The above instruction is also specified in hexadecimal in part 2 of section b) of Figure Assembly Languages Even with the hexadecimal or the octal number system notation, it is extremely difficult to write programs in a machine language: it is particularly difficult to remember the opcodes of instructions and to specify the operands of instructions. Another language called assembly language was created to allow programmers to use symbols instead of the digits of a number system to write the instructions of a program. There is an assembly language for each machine language in such a way that an assembly language instruction is the symbolic representation of a machine language instruction. For example, in section b) of Figure 1.1, the assembly language instruction that corresponds to the machine language instruction provided in parts1 and 2 is provided part 3. Since a program is executed by a computer only if it is written in its machine language, a program written in the assembly language of a computer most first be translated into machine language before it can be executed by that computer. For each type of computer, there is a system program called assembler that translates programs written in the assembly language of that computer into its machine language. The assembler takes as input a program in assembly language and produces as output a program in machine language. High-Level Languages Writing programs in a low-level (machine or assembly) language requires the programmer to know the detailed structure of the underlying computer. This knowledge of the computer makes it possible to write more efficient programs that better use the system resources. However, programs written in low-level languages lack the flexibility and the portability of high-level language programs.

4 4 A high-level language program reflects the structure of an algorithm, and does not depend on the structure of any particular type of computer; it may be executed on any computer, and a high-level language programmer does not need to know the structure of any particular computer. However, for a high-level language program to be executed by a computer, it must first be translated into the machine language of that computer. A compiler is a system program that translates high-level language programs into machine language. For each type of computer, there is a compiler for each high-level language. For examples, the C/C++ compiler for the IBM PC and compatible computers, the C/C++ compiler for the Sun Microsystem computers, the Java compiler for the IBM PC and compatible computers, the Java compiler for the Apple Macintosh computers,...etc. Compilers, assemblers, and other system software that are necessary for the development of programs are discussed in chapter 5. Exercise 1.1 Part I Fill in the blanks with the most appropriate answers. 1. A is the specification in a programming language of the step-bystep operations that the computer must execute in order to perform a task or to solve a problem. 2. The two major classes of programming language are: and. 3. Low-level languages are and. 4. A program in language consists of instructions and data represented as sequences of binary digits (or bits), 0's and 1's. 5. A specifies a fundamental operation that the computer is capable of carrying out. 6. A program is executed by a computer only if it is written in. 7. The of an instruction specifies the operation to be carried out by the computer. 8. The of an instruction specifies the data, or the location (inside of the computer) of the data on which the operation is to be carried out. 9. An is a system program that takes as input a program in assembly language and produces as output a program in machine language. 10. A is a system program that takes as input a program in a high-level language and produces as output a program in machine language.

5 5 Part II Answer by True or False. 1. Each type of computer has a collection of machine language instructions called instruction set that is defined by the computer designer. True False 2. A machine language program for IBM PC and compatible computers can also be executed by an Apple Macintosh computer. True False 3. Binary information may also be specified in hexadecimal or octal. True False 4. An assembly language instruction corresponds exactly to one machine language instruction. True False 5. A computer can execute a program in assembly language. True False 6. Some computers do not have a machine language instruction set. True False 7. In order to write programs in a machine or assembly language, the programmer must know the structure of the corresponding computer. True False 8. Some computers can execute programs written in C++. True False 9. The same C++ compiler may be used to translate a C++ program into the machine languages of IBM PC and compatible computers and Apple Macintosh computers. True False 10. In order to write programs in some high-level languages, programmers must know the structure of the computer on which the program will be executed. True False 1.2 Number Systems In our daily activities, we use the decimal number system to represent numeric data. In this system also known as the number system of radix 10 or base 10, ten symbols (the digits 0 through 9) are used to represent positive integers. It is a positional number system, because the value that corresponds to each digit in a number depends on its position within that number: each digit represents a multiple of a power of 10 as in the following example: 3052 = 3 x x x x = 3 x x x x 10 Unlike what we do in our daily activities, information inside a digital computer is represented as a sequence of 0's and 1's. That means, computers use the binary (or base 2) number system to represent information. However, binary information is difficult to process by most people, because of their length, and the many possibilities to make mistakes.

6 6 It is more convenient to express binary information in a more compact form by using the hexadecimal (base 16) number system or the octal (base 8) number system. For example, the binary number is expressed in octal as 6153 and in hexadecimal as C6B. In the following sections, we discuss the binary and the hexadecimal number systems and also show how they are related to the decimal system, and to each other. Binary Integers In binary (or base 2), two digits, 0 and 1, called binary digits or bits are used to represent positive integers. A binary integer is a sequence of the bits 0 and 1 in such a way that the value that corresponds to each digit depends on its position within the number. Examples of binary integers are 02, 12, 102, 112, 1010, and The binary integer is read: "one, one, zero, one, zero, zero, one, base 2." Subscript 2 is added to the sequence of bits in order to indicate that it is a binary number. Alternatively, the letter B or b may also be appended to it as in B, or b. The decimal value of the n-digit binary integer b n-1 b n-2... b 1 b 0 is computed as: n-1 n b n-1 x 2 + b n-2 x b 1 x 2 + b 0 x 2 That means, each position in a binary integer corresponds to a power of 2 as 0 1 follows: the first position to the right corresponds to 2 or 1, the next to 2,..., etc. Example 1.1 illustrates the conversion process from binary to decimal. Example 1.1 Conversion from Binary to Decimal Convert the binary integers 02, 12, 102, 10002, and to decimal. 0 a) 02 = 0x2 = 0 0 b) 1 = 1x2 = c) 10 = 1x2 + 0x2 = d) 1000 = 1x2 + 0x2 + 0x2 + 0x2 = 8 2 e) = 1x2 + 1x2 + 0x2 + 1x2 + 0x2 + 1x2 + 1x2 + 1x = = 215

7 7 Exercise 1.2 Convert the following binary integers to decimal: a. 1012, b. 112 c d e Conversion from Decimal to Binary Two methods are commonly used to convert a positive decimal integer to binary. The first method uses repeated divisions by two, whereas the second uses the decomposition of a positive decimal integer into a sum of powers of two. First method The binary representation b n-1 b n-2... b 1 b 0 of a positive decimal integer m is obtained as follows: 1. Divide the integer m by 2, and 2. As long as the new quotient is not zero, divide it by 2. b 0 is the first remainder, b 1 the second,..., and b n-1 is the last remainder. This procedure is illustrated in Example 1.2. Example 1.2 Conversion from Decimal to Binary (First Method) Convert the decimal integers 8 and 53 to binary using the first conversion method. 8 2 = 4 with remainder = 2 with remainder = 1 with remainder = 0 with remainder = = 26 with remainder = 13 with remainder = 6 with remainder = 3 with remainder = 1 with remainder = 0 with remainder =

8 8 Exercise 1.3 Convert the following decimal integers to binary using the first conversion method: a. 10 b. 28 c. 523 d e Second Method The binary representation b n-1 b n-2... b 1 b 0 of a positive decimal integer m is obtained as follows: 1. Find all powers of 2 that add up to m. i 2. set b i to 1 if 2 is one of the powers, otherwise set it to 0. Use Table 1.1 to find all powers of two that add up to a decimal integer m as follows: 1. Find the highest power of two less than or equal to m. 2. Subtract it from m. 3. Repeat steps 1 and 2 for the new difference until you obtain a difference of 0. This procedure is illustrated in Example 1.3. Example 1.3 Conversion from Decimal to Binary (Second Method) Convert the decimal integers 47 and 2840 to binary using the second conversion method: = = = = = = = = = = 0 47 = = = = = =

9 9 Exercise 1.4 Convert the following decimal integers to binary using the second conversion method: a. 28 b. 523 c d. 5,753 e. 8, 234 Hexadecimal Integers In hexadecimal (also known as base 16), sixteen digits (0 through 9 and A, B, C, D, E and F) are used to represent positive integers. The values of the digits A, B, C, D, E, and F are respectively 10, 11, 12, 13, 14, and 15. An hexadecimal integer is a sequence of these digits arranged in such a way that the value that each digit within the sequence represents, depends on its position in the sequence. The hexadecimal integer 2AF6h is read: " two, 'A', 'F', six, in hexadecimal (or base 16)." To specify that a number is an hexadecimal number, we usually append a lowercase or uppercase H to it. Alternatively, the subscript 16 may also be appended to it as in 2AF6. The decimal value of the n-digit hexadecimal integer h n-1 h n-2... h 1 h 0 is computed as follows: n-1 n h n-1 x 16 + h n-2 x h 1 x 16 + h 0 x 16 Each position in an hexadecimal integer corresponds to a power of 16, 0 1 starting with 16 or 1 to the right, then 16,..., etc. Example 1.4 illustrates the conversion procedure from hexadecimal to decimal. Multiples of powers of 16 are provided in Table 1.2. Each column in Table 1.2 corresponds to a 0 7 power of 16, starting with 16 to the right, up to 16 to the left. In each column, the decimal integer that corresponds to an hexadecimal digit is the multiple of power of 16 in that column that corresponds to that digit. For 2 example, 5x16 is 1280, because in column 3, 1280 corresponds to digit 5. 16

10 10 Example 1.4 Conversion from Hexadecimal to Decimal Convert the hexadecimal integers 10h, 530h, and A05Fh to decimal. 1 0 a) 10h = 1 x x 16 = b) 530h = 5x16 + 3x16 + 0x16 = 1, = 1, c) A05Fh = 10x16 + 0x16 + 5x x16 = 40, = 41,055 Exercise 1.5 Convert the following hexadecimal integers to decimal: a. 1Ah b. 20Eh c. 412h d. 2BC5 e. F50A Conversion from Decimal to Hexadecimal The procedures to convert from decimal to hexadecimal are very similar to those used to convert from decimal to binary: the first method uses repeated divisions by sixteen, whereas the second uses the decomposition of a positive integer into a sum of multiples of powers of sixteen. First method The hexadecimal representation, h n-1 h n-2... h 1 h 0, of a positive decimal integer m is obtained as follows: 1. Divide the decimal integer m by 16, and 2. As long as the new quotient is not zero, divide it by n-1 h is the first remainder, h the second,..., and h the last remainder. This procedure is illustrated in Example 1.5.

11 11 Example 1.5 Conversion from Decimal to Hexadecimal (First Method) Convert the decimal integers, 18, 32, and 1213 to hexadecimal. a) = 1 with remainder = 0 with remainder = 1216 b) = 2 with remainder = 0 with remainder = 2016 c) = 75 with remainder 13 ( D ) = 4 with remainder 11 ( B ) 4 16 = 0 with remainder = 4BD16 Exercise 1.6 Convert the following decimal integers to hexadecimal using the first conversion method: a. 28 b. 523 c d e Second Method n-1 n The hexadecimal representation, h h... h h, of a positive decimal integer m is obtained as follows:

12 12 1. Find all multiples of powers of 16 that add up to m. i 2. If 16 is one of the powers in this decomposition, set h i to its coefficient; otherwise set it to 0. Use Table 1.3 to find all multiples of powers of sixteen that add up to a decimal integer m as follows: 1. Find the largest multiple of a power of sixteen less than or equal to m. 2. Subtract it from m. 3. Repeat steps 1 and 2 for the new difference until you obtain a difference of 0. This procedure is illustrated in Example 1.6. Example 1.6 Conversion from Decimal to Hexadecimal (Second Method) Convert the decimal integers 108 and to hexadecimal = = = = 6 x x 16 = 6Ch = = = = = F x x 16 + B x 16 = F03B 16 Exercise 1.7 Convert the following decimal integers to hexadecimal using the second conversion method: a. 28 b. 523 c d e

13 13 Binary and Hexadecimal Conversions The conversion from binary to hexadecimal, or from hexadecimal to binary is done by observing that each of the 16 hexadecimal digits corresponds to one of the 4-bit integers as follows: 0000 = = = = C 0001 = = = = D 0010 = = = A 1110 = E 0011 = = = B 1111 = F To convert a sequence of bits to hexadecimal, start from the right of the sequence and replace every four consecutive bits in the sequence with its corresponding hexadecimal digit. Additional 0's may be added to the left of the sequence if necessary. An hexadecimal integer is converted to binary by replacing each hexadecimal digit in the number with its corresponding 4-bit integer. These two conversion procedures are illustrated in Example 1.7. Example 1.7 Binary and Hexadecimal Conversions a) Convert the binary integers 1102, , and to hexadecimal = 6h = = 2Ah 2 2 A = = 1D30h 2 1 D 3 0 b) Convert the hexadecimal numbers 35h and A0B4h to binary. 35 = = A0B4h = = A 0 B 4

14 14 Exercise Convert the following binary integers to hexadecimal: a b c Convert the following hexadecimal integers to binary: a. 27h b. 3A0h c. C14Dh Arithmetic Operations The rules that apply to arithmetic in binary and hexadecimal number systems are the same as those that apply to arithmetic in the decimal number system. However, when you perform these operations, you must remember that the binary integer 10b is 2 in decimal, and that the hexadecimal integer 10h is 16 in decimal. Binary Addition We first introduce the addition of two bits as follows: You add two binary integers with more than one bit by following the same rules that you use for decimal addition: add individual bits as specified above, and if a carry is generated in any position, you add it to the position immediately to the left. Example 1.8 illustrates the binary addition. Example 1.8 Addition of Unsigned Binary Integers a b c

15 15 Exercise 1.9 Perform the following operations on binary integers: a b c Hexadecimal Addition You add two hexadecimal digits by first converting them to decimal, performing the addition in decimal, and then converting the result back to hexadecimal. For example, to add Dh + Ah, we perform the addition The result is 23, which corresponds to the hexadecimal integer 17h. Therefore, Dh + Ah equals 17h. Table 1.2 illustrates the addition of hexadecimal digits. You add two hexadecimal integers with more than one digit by following the same rules that you use for binary addition: add individual hexadecimal digits as specified above, and if a carry is generated in any position, you add it to the position immediately to the left. Example 1.9 illustrates the addition in hexadecimal. Example 1.9 Addition of Hexadecimal Integers a. 1 0 B 7 b. 6 A 8 9 c. 5 4 F 9 E A 0 + D C 6 3 A 1 5 D C E D 8

16 16 Exercise 1.10 Perform the following addition on hexadecimal integers: a. 1 A 0 6 b. 6 A F 5 c. 4 F 4 B + 5 C D E 9 A Subtraction of Binary and Hexadecimal Integers Subtracting binary or hexadecimal integers follows the same rules as those for decimal integers subtraction. In particular, before you can subtract a larger digit from a smaller one, you must borrow a 1 from the digit immediately to the left; and a borrowed digit becomes 10 in the current position. You subtract an hexadecimal digit from another one by first converting them to decimal, perform the subtraction in decimal, and then convert the result back to hexadecimal. Example 1.10 and Example 1.11 illustrate the subtraction of binary integers, and hexadecimal integers respectively. Example 1.10 Subtracting Binary Integers a b c

17 17 Exercise 1.11 Perform the following operations on binary integers: a b c Example 1.11 Subtracting Hexadecimal Integers 0 4 D F F a. 3 D 5 F b. 1 0 C 5 2 c. E 0 0 B A - A D 4 3 B A 3 B D F 7 E 3 Exercise 1.12 Perform the following subtraction on hexadecimal integers: a. 1 A 0 6 b. 6 A F 5 c. 4 F 4 B + 5 C D E 9 A

18 18 Multiplication and Division of Binary Integers You multiply or divide binary integers the same way you multiply or divide decimal integers. Example 1.12 illustrates the multiplication and the division of binary integers. Example 1.12 Multiplying and Dividing Unsigned Binary Integers a) x b) In the binary division of by 110, the quotient is and the remainder is 11: ) Exercise 1.13 Perform the following operations on binary integers: a x b

19 19 Table 1.1 Powers of two n n n 2 n , , , ,536 Table 1.2 Addition of Hexadecimal Digits A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A B C D E F A A B C D E F B B C D E F A C C D E F A 1B D D E F A 1B 1C E E F A 1B 1C 1D F F A 1B 1C 1D 1E

20 20 Table 1.3 Hexadecimal-Decimal conversion Table Hex Dec Hex Dec Hex Dec Hex Dec Hex Dec Hex Dec Hex Dec Hex Dec ,435, ,777, ,048, , , ,870, ,554, ,097, , , ,306, ,331, ,145, , , ,073,741, ,108, ,194, , , , ,342,177, ,886, ,242, , , , ,610,612, ,663, ,291, , , , ,879,048, ,440, ,340, , , , ,147,483, ,217, ,388, , , , ,415,919, ,994, ,437, , , , A 2,684,354,560 A 167,772,160 A 10,485,760 A 655,360 A 40,960 A 2,560 A 160 A 10 B 2,952,790,016 B 184,549,376 B 11,534,336 B 720,896 B 45,056 B 2,816 B 176 B 11 C 3,221,225,472 C 201,326,592 C 12,582,912 C 786,432 C 49,152 C 3,072 C 192 C 12 D 3,489,660,928 D 218,103,808 D 13,631,488 D 851,968 D 53,248 D 3,328 D 208 D 13 E 3,758,096,384 E 234,881,024 E 14,680,064 E 917,504 E 57,344 E 3,584 E 224 E 14 F 4,026,531,840 F 251,658,240 F 15,728,640 F 983,040 F 61,440 F 3,840 F 240 F

21 21 Chapter 1: Exercises 1. Convert the following binary integers to decimal: a b c d e f g h Convert the binary integers in Exercise 1 to hexadecimal. 3. Convert the following hexadecimal integers to decimal: a. 302 b. 5CF c. F40 d e. 24B6 f. 3AD2 g. 5E04E h. C20EE 4. Convert the hexadecimal integers in Exercise 3 to binary. 5. Convert the following decimal integers to binary. a. 13 b. 24 c. 85 d. 105 e. 256 f. 314 g h Convert the decimal integers in Exercise 5 to hexadecimal. 7. Each octal digit corresponds to a 3-bit integer as follows: 0 = = = = = = = = 111 A) Convert to octal the following binary integers: a b c B) Convert to binary the following octal integers: a. 25o b. 342o c. 701o 8. Perform the following operations on binary integers: a b c d e f g h i j Perform the following operations os: a x 1101 b x 1110 c d Perform the following operations on hexadecimal integers: a. 8D5 + 41A b. A5B + 53C c d. DEC4 + DA5D e. E8C - A21 f. E8C - A2E g. 3A41-1B2C h. 58DC - 3CED

22 22 Chapter 1: Solutions of Exercises 1. a. 29 b. 43 c. 61 d. 109 e. 236 f. 189 g h a. 1Dh b. 2Bh c. 3Dh d. 6Dh e. ECh f. BDh g. 6DAh h. 84Ah 3. a. 770 b c d e f g. 385,102 h. 794, a b c d e f g h a b c d e f g h a. Dh b. 18h c. 55h d. 69h e. 100h f. 13Ah g. 5EAh h. 30A4h. 7. a. 113o b. 246o c. 325o d e f a b c d e f g h i j a b c. Quotient = 10110; Remainder = 1100 d. Quotient = 10011; Remainder = a. CEFh b. F97h c. 130ECh d. 1B921h e. 46Bh f. 45Eh g. 1F15h h. 1BEFh.

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal Positional notation Ch.. /continued Conversions between Decimal and Binary Binary to Decimal - use the definition of a number in a positional number system with base - evaluate the definition formula using

More information

CS & IT Conversions. Magnitude 10,000 1,

CS & IT Conversions. Magnitude 10,000 1, CS & IT Conversions There are several number systems that you will use when working with computers. These include decimal, binary, octal, and hexadecimal. Knowing how to convert between these number systems

More information

Final Labs and Tutors

Final Labs and Tutors ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South

More information

Octal & Hexadecimal Number Systems. Digital Electronics

Octal & Hexadecimal Number Systems. Digital Electronics Octal & Hexadecimal Number Systems Digital Electronics What, More Number Systems? Why do we need more number systems? Humans understand decimal Check out my ten digits! Digital electronics (computers)

More information

Number Systems CHAPTER Positional Number Systems

Number Systems CHAPTER Positional Number Systems CHAPTER 2 Number Systems Inside computers, information is encoded as patterns of bits because it is easy to construct electronic circuits that exhibit the two alternative states, 0 and 1. The meaning of

More information

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming) Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming) Learning any imperative programming language involves mastering a number of common concepts: Variables: declaration/definition

More information

CHAPTER 2 Number Systems

CHAPTER 2 Number Systems CHAPTER 2 Number Systems Objectives After studying this chapter, the student should be able to: Understand the concept of number systems. Distinguish between non-positional and positional number systems.

More information

TOPIC: NUMBER SYSTEMS

TOPIC: NUMBER SYSTEMS Ministry of Secondary Education Progressive Comprehensive High School PCHS Mankon Bamenda Department of Computer Studies Republic of Cameroon Peace Work - Fatherland TOPIC: NUMBER SYSTEMS Class: Comp.

More information

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning 2 Number Systems 2.1 Foundations of Computer Science Cengage Learning 2.2 Objectives After studying this chapter, the student should be able to: Understand the concept of number systems. Distinguish between

More information

CMPE223/CMSE222 Digital Logic Design. Positional representation

CMPE223/CMSE222 Digital Logic Design. Positional representation CMPE223/CMSE222 Digital Logic Design Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Positional representation First consider integers Begin with positive only

More information

Numeral system Numerals

Numeral system Numerals Book B: Chapter 9 Different Numeral Systems Revision. (a) Numerals in the system Numeral system Numerals Denary,,,,,, 6, 7, 8 and 9 Binary and Hexadecimal,,,,,, 6, 7, 8, 9, A (i.e. ), B (i.e. ), C (i.e.

More information

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS). 2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS). 2.. Natural Binary Code (NBC). The positional code with base 2 (B=2), introduced in Exercise, is used to encode

More information

CHW 261: Logic Design

CHW 261: Logic Design CHW 261: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed14 http://bu.edu.eg/staff/ahmedshalaby14# Slide 1 Slide 2 Slide 3 Digital Fundamentals CHAPTER

More information

Number Systems. Both numbers are positive

Number Systems. Both numbers are positive Number Systems Range of Numbers and Overflow When arithmetic operation such as Addition, Subtraction, Multiplication and Division are performed on numbers the results generated may exceed the range of

More information

Digital Logic Lecture 2 Number Systems

Digital Logic Lecture 2 Number Systems Digital Logic Lecture 2 Number Systems By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department Outline Introduction. Basic definitions. Number systems types. Conversion between different

More information

Internal Data Representation

Internal Data Representation Appendices This part consists of seven appendices, which provide a wealth of reference material. Appendix A primarily discusses the number systems and their internal representation. Appendix B gives information

More information

Computer Organization and Assembly Language. Lab Session 01

Computer Organization and Assembly Language. Lab Session 01 Objective: Lab Session 01 Introduction to Assembly Language Tools and Familiarization with Emu8086 environment To be able to understand Data Representation and perform conversions from one system to another

More information

Beyond Base 10: Non-decimal Based Number Systems

Beyond Base 10: Non-decimal Based Number Systems Beyond Base : Non-decimal Based Number Systems What is the decimal based number system? How do other number systems work (binary, octal and hex) How to convert to and from nondecimal number systems to

More information

What Is It? Instruction Register Address Register Data Register

What Is It? Instruction Register Address Register Data Register What Is It? Consider the following set of 32 binary digits, written in blocks of four so that the example is not impossible to read. 0010 0110 0100 1100 1101 1001 1011 1111 How do we interpret this sequence

More information

Level ISA3: Information Representation

Level ISA3: Information Representation Level ISA3: Information Representation 1 Information as electrical current At the lowest level, each storage unit in a computer s memory is equipped to contain either a high or low voltage signal Each

More information

MACHINE LEVEL REPRESENTATION OF DATA

MACHINE LEVEL REPRESENTATION OF DATA MACHINE LEVEL REPRESENTATION OF DATA CHAPTER 2 1 Objectives Understand how integers and fractional numbers are represented in binary Explore the relationship between decimal number system and number systems

More information

Chapter 1 Review of Number Systems

Chapter 1 Review of Number Systems 1.1 Introduction Chapter 1 Review of Number Systems Before the inception of digital computers, the only number system that was in common use is the decimal number system which has a total of 10 digits

More information

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University. Data Representation ti and Arithmetic for Computers Rui Wang, Assistant professor Dept. of Information and Communication Tongji University it Email: ruiwang@tongji.edu.cn Questions What do you know about

More information

NUMERIC SYSTEMS USED IN NETWORKING

NUMERIC SYSTEMS USED IN NETWORKING NUMERIC SYSTEMS USED IN NETWORKING Decimal - Binary - Hexadecimal Table ASCII Code 128 64 32 16 8 4 2 1 The Letter A 0 1 0 0 0 0 0 1 Data Units Base 10 Numbering System Base 2 Numbering System Decimal

More information

Beyond Base 10: Non-decimal Based Number Systems

Beyond Base 10: Non-decimal Based Number Systems Beyond Base : Non-decimal Based Number Systems What is the decimal based number system? How do other number systems work (binary, octal and hex) How to convert to and from nondecimal number systems to

More information

Number System. Introduction. Decimal Numbers

Number System. Introduction. Decimal Numbers Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

More information

Number representations

Number representations Number representations Number bases Three number bases are of interest: Binary, Octal and Hexadecimal. We look briefly at conversions among them and between each of them and decimal. Binary Base-two, or

More information

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Chapter 1: Basic Concepts Slides prepared by Kip R. Irvine Revision date: 09/15/2002 Chapter corrections (Web) Printing a slide show

More information

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng. CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. 1 Part 1: Data Representation Our goal: revisit and re-establish fundamental of mathematics for the computer architecture course Overview: what are bits

More information

Chapter 2. Binary Values and Number Systems

Chapter 2. Binary Values and Number Systems Chapter 2 Binary Values and Number Systems Numbers Natural numbers, a.k.a. positive integers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative numbers A

More information

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion Topic : Introduction To computers Faculty : Department of commerce and Management BY: Prof.Meeta R. Gujarathi E mail: meetargujarathi@gmail.com Octal Hexadecimal Number conversion TOPICS Other Number Systems

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted

More information

Chapter 2 COMPUTER SYSTEM HARDWARE

Chapter 2 COMPUTER SYSTEM HARDWARE Chapter 2 COMPUTER SYSTEM HARDWARE A digital computer system consists of hardware and software. The hardware consists of the physical components of the system, whereas the software is the collection of

More information

Bits. Binary Digits. 0 or 1

Bits. Binary Digits. 0 or 1 Data Representation Bits Binary Digits 0 or 1 Everything stored in a computer is stored as bits. Bits can mean different things depending on how the software or hardware interpret the bits Bits are usually

More information

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes Digital Fundamentals CHAPTER 2 Number Systems, Operations, and Codes Decimal Numbers The decimal number system has ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 The decimal numbering system has a base of

More information

BINARY SYSTEM. Binary system is used in digital systems because it is:

BINARY SYSTEM. Binary system is used in digital systems because it is: CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

More information

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. Digital Logic 1 Data Representations 1.1 The Binary System The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. The system we

More information

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

More information

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics Numbers & Number Systems Introduction Numbers and Their Properties Multiples and Factors The Division Algorithm Prime and Composite Numbers Prime Factors

More information

6. Binary and Hexadecimal

6. Binary and Hexadecimal COMP1917 15s2 6. Binary and Hexadecimal 1 COMP1917: Computing 1 6. Binary and Hexadecimal Reading: Moffat, Section 13.2 Outline Number Systems Binary Computation Converting between Binary and Decimal Octal

More information

T02 Tutorial Slides for Week 2

T02 Tutorial Slides for Week 2 T02 Tutorial Slides for Week 2 ENEL 353: Digital Circuits Fall 2017 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 19 September, 2017

More information

Experiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program.

Experiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program. Experiment 3 Introduction: In this experiment the students are exposed to the structure of an assembly language program and the definition of data variables and constants. Objectives: Assembly language

More information

Module 1: Information Representation I -- Number Systems

Module 1: Information Representation I -- Number Systems Unit 1: Computer Systems, pages 1 of 7 - Department of Computer and Mathematical Sciences CS 1305 Intro to Computer Technology 1 Module 1: Information Representation I -- Number Systems Objectives: Learn

More information

DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN DIGITAL SYSTEM DESIGN UNIT I: Introduction to Number Systems and Boolean Algebra Digital and Analog Basic Concepts, Some history of Digital Systems-Introduction to number systems, Binary numbers, Number

More information

QUIZ: Generations of computer technology. Hardware:

QUIZ: Generations of computer technology. Hardware: QUIZ: Generations of computer technology Hardware: 1. 2. 3. 4. 5. 1 QUIZ: Generations of computer technology Software: 1. 2. 3. 4. 5. 6. 2 Chapter 2 Binary Values and Number Systems Numbers Natural numbers,

More information

Objectives. Connecting with Computer Science 2

Objectives. Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn how numbering systems are used to count Understand the significance of positional value

More information

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design 1 COE 0- Digital Logic Number Systems II Dr. Abdulaziz Y. Barnawi COE Department KFUPM COE 0 Logic Design January 3, 016 Objectives Base Conversion Decimal to other bases Binary to Octal and Hexadecimal

More information

Chapter 1 Emad Felemban

Chapter 1 Emad Felemban Chapter 1 Emad Felemban Digital Computers and Digital Systems Binary Numbers Number Base Conversion Octal and Hexadecimal Numbers Complements Singed Binary Numbers Binary Codes Binary Storage and Registers

More information

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr Number Systems and Binary Arithmetic Quantitative Analysis II Professor Bob Orr Introduction to Numbering Systems We are all familiar with the decimal number system (Base 10). Some other number systems

More information

Review of Data Representation & Binary Operations Dhananjai M. Rao CSA Department Miami University

Review of Data Representation & Binary Operations Dhananjai M. Rao CSA Department Miami University Review of Data Representation & Binary Operations Dhananjai M. Rao () CSA Department Miami University 1. Introduction In digital computers all data including numbers, characters, and strings are ultimately

More information

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds. ECE-78: Digital Logic Design Fall 6 UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers

More information

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 CS 64 Lecture 2 Data Representation Reading: FLD 1.2-1.4 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 ) + (1x10 0 ) 1010 10?= 1010 2?= 1

More information

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers.

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers. Chapter One 1.1 Introduction: Numbers are used to express quantities. There are many numerations systems used in the field of digital electronics, one of the most important being the binary system of numeration

More information

Octal and Hexadecimal Integers

Octal and Hexadecimal Integers Octal and Hexadecimal Integers CS 350: Computer Organization & Assembler Language Programming A. Why? Octal and hexadecimal numbers are useful for abbreviating long bitstrings. Some operations on octal

More information

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System Moodle 1 WILLINGDON COLLEGE SANGLI ELECTRONICS (B. Sc.-I) Introduction to Number System E L E C T R O N I C S Introduction to Number System and Codes Moodle developed By Dr. S. R. Kumbhar Department of

More information

Chapter 2. Data Representation in Computer Systems

Chapter 2. Data Representation in Computer Systems Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

More information

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur 1 Number Representation 2 1 Topics to be Discussed How are numeric data items actually

More information

Applied Computer Programming

Applied Computer Programming Applied Computer Programming Representation of Numbers. Bitwise Operators Course 07 Lect.eng. Adriana ALBU, PhD Politehnica University Timisoara Internal representation All data, of any type, processed

More information

Lecture 2: Number Systems

Lecture 2: Number Systems Lecture 2: Number Systems Syed M. Mahmud, Ph.D ECE Department Wayne State University Original Source: Prof. Russell Tessier of University of Massachusetts Aby George of Wayne State University Contents

More information

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary

More information

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES Structure 2.0 Introduction 2.1 Unit Objectives 2.2 Number Systems 2.3 Bits and Bytes 2.4 Binary Number System 2.5 Decimal Number System 2.6 Octal Number System

More information

QUIZ: Generations of computer technology. Hardware:

QUIZ: Generations of computer technology. Hardware: QUIZ: Generations of computer technology Hardware: 1. 2. 3. 4. 5. 1 QUIZ: Generations of computer technology Software: 1. 2. 3. 4. 5. 6. 2 Steampunk! 3 The Telectroscope, 1878-2008 Steampunk Wikipedia

More information

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects: Numeral Systems -Numeral System -Positional systems -Decimal -Binary -Octal Subjects: Introduction A numeral system (or system of numeration) is a writing system for expressing numbers, that is a mathematical

More information

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem   ahmadsm AT kfupm Phone: Office: COE 0: Digital Logic Design Number Systems Part Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office: -34 Objectives Arithmetic operations: Binary number system Other number systems Base Conversion

More information

The type of all data used in a C++ program must be specified

The type of all data used in a C++ program must be specified The type of all data used in a C++ program must be specified A data type is a description of the data being represented That is, a set of possible values and a set of operations on those values There are

More information

Signed number Arithmetic. Negative number is represented as

Signed number Arithmetic. Negative number is represented as Signed number Arithmetic Signed and Unsigned Numbers An 8 bit number system can be used to create 256 combinations (from 0 to 255), and the first 128 combinations (0 to 127) represent positive numbers

More information

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010 Contents Number systems and conversion Binary arithmetic Representation of negative numbers Addition of two s complement numbers Addition of one s complement numbers Binary s Readings Unit.~. UNIT NUMBER

More information

Citrix IMA Service Error Codes

Citrix IMA Service Error Codes Citrix IMA Service Error Codes This article contains Citrix IMA Service error codes that can appear in the Event Viewer. Page 1 IMA Error Codes Hex Value Signed Value Unsigned Value Mnemonic 80000001h

More information

MC1601 Computer Organization

MC1601 Computer Organization MC1601 Computer Organization Unit 1 : Digital Fundamentals Lesson1 : Number Systems and Conversions (KSB) (MCA) (2009-12/ODD) (2009-10/1 A&B) Coverage - Lesson1 Shows how various data types found in digital

More information

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds. UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers of ): DIGIT 3 4 5 6 7 8 9 Number:

More information

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC CHAPTER V-1 CHAPTER V CHAPTER V NUMBER SYSTEMS AND ARITHMETIC CHAPTER V-2 NUMBER SYSTEMS RADIX-R REPRESENTATION Decimal number expansion 73625 10 = ( 7 10 4 ) + ( 3 10 3 ) + ( 6 10 2 ) + ( 2 10 1 ) +(

More information

Lecture 9. INC and DEC. INC/DEC Examples ADD. Arithmetic Operations Overflow Multiply and Divide

Lecture 9. INC and DEC. INC/DEC Examples ADD. Arithmetic Operations Overflow Multiply and Divide Lecture 9 INC and DEC Arithmetic Operations Overflow Multiply and Divide INC adds one to a single operand DEC decrements one from a single operand INC destination DEC destination where destination can

More information

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010 // EE : INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN Lecture : Introduction /9/ Avinash Kodi, kodi@ohio.edu Agenda Go over the syllabus Introduction ti to Digital it Systems // Why Digital Systems?

More information

Fundamentals of Programming Session 2

Fundamentals of Programming Session 2 Fundamentals of Programming Session 2 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2013 Sharif University of Technology Outlines Programming Language Binary numbers Addition Subtraction

More information

Memory Addressing, Binary, and Hexadecimal Review

Memory Addressing, Binary, and Hexadecimal Review C++ By A EXAMPLE Memory Addressing, Binary, and Hexadecimal Review You do not have to understand the concepts in this appendix to become well-versed in C++. You can master C++, however, only if you spend

More information

Chapter Overview. Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Printing this Slide Show

Chapter Overview. Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Printing this Slide Show Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Chapter 1: Basic Concepts Chapter Overview Welcome to Assembly Language Virtual Machine Concept Data Representation Boolean Operations

More information

data within a computer system are stored in one of 2 physical states (hence the use of binary digits)

data within a computer system are stored in one of 2 physical states (hence the use of binary digits) Binary Digits (bits) data within a computer system are stored in one of 2 physical states (hence the use of binary digits) 0V and 5V charge / NO charge on a transistor gate ferrite core magnetised clockwise

More information

Fundamentals of Programming (C)

Fundamentals of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamentals of Programming (C) Group 8 Lecturer: Vahid Khodabakhshi Lecture Number Systems Department of Computer Engineering Outline Numeral Systems

More information

Chapter 2 Binary Values and Number Systems

Chapter 2 Binary Values and Number Systems Chapter 2 Binary Values and Number Systems Chapter Goals 10 進位 2 / 8 / 16 進位 進位系統間轉換 各進位系統小數表示 各進位系統加減法 各進位系統乘除法 2 24 6 Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to

More information

in this web service Cambridge University Press

in this web service Cambridge University Press 978-0-51-85748- - Switching and Finite Automata Theory, Third Edition Part 1 Preliminaries 978-0-51-85748- - Switching and Finite Automata Theory, Third Edition CHAPTER 1 Number systems and codes This

More information

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 APPENDIX A.1 Number systems and codes Since ten-fingered humans are addicted to the decimal system, and since computers

More information

Positional Number System

Positional Number System Positional Number System A number is represented by a string of digits where each digit position has an associated weight. The weight is based on the radix of the number system. Some common radices: Decimal.

More information

When using computers, it should have a minimum number of easily identifiable states.

When using computers, it should have a minimum number of easily identifiable states. EET 3 Chapter Number Systems (B) /5/4 PAGE Number Systems (B) Number System Characteristics (Tinder) What s important in choosing a number system? Basically, there are four important characteristics desirable

More information

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

Excerpt from Art of Problem Solving Volume 1: the Basics 2014 AoPS Inc. Chapter 5 Using the Integers In spite of their being a rather restricted class of numbers, the integers have a lot of interesting properties and uses. Math which involves the properties of integers is

More information

Unit 3. Operators. School of Science and Technology INTRODUCTION

Unit 3. Operators. School of Science and Technology INTRODUCTION INTRODUCTION Operators Unit 3 In the previous units (unit 1 and 2) you have learned about the basics of computer programming, different data types, constants, keywords and basic structure of a C program.

More information

2010 Summer Answers [OS I]

2010 Summer Answers [OS I] CS2503 A-Z Accumulator o Register where CPU stores intermediate arithmetic results. o Speeds up process by not having to store these results in main memory. Addition o Carried out by the ALU. o ADD AX,

More information

Chapter 2 Exercises and Answers

Chapter 2 Exercises and Answers Chapter 2 Exercises and nswers nswers are in blue. For Exercises -5, match the following numbers with their definition.. Number. Natural number C. Integer number D. Negative number E. Rational number unit

More information

Number Systems Base r

Number Systems Base r King Fahd University of Petroleum & Minerals Computer Engineering Dept COE 2 Fundamentals of Computer Engineering Term 22 Dr. Ashraf S. Hasan Mahmoud Rm 22-44 Ext. 724 Email: ashraf@ccse.kfupm.edu.sa 3/7/23

More information

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM COURSE / CODE DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) NUMBER SYSTEM A considerable subset of digital systems deals with arithmetic operations. To understand the

More information

THE LOGIC OF COMPOUND STATEMENTS

THE LOGIC OF COMPOUND STATEMENTS CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS Copyright Cengage Learning. All rights reserved. SECTION 2.5 Application: Number Systems and Circuits for Addition Copyright Cengage Learning. All rights reserved.

More information

EE292: Fundamentals of ECE

EE292: Fundamentals of ECE EE292: Fundamentals of ECE Fall 2012 TTh 10:00-11:15 SEB 1242 Lecture 22 121115 http://www.ee.unlv.edu/~b1morris/ee292/ 2 Outline Review Binary Number Representation Binary Arithmetic Combinatorial Logic

More information

Course Syllabus [1/2]

Course Syllabus [1/2] Course Syllabus [1/2] Instructor 逄愛君, acpang@csie.ntu.edu.tw Office Number: 417, Office Hour: 15:00~17:00 (Thursday) Textbook Assembly Language for Intel-Based Computers, Kip R. Irvine, Pearson Education,

More information

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee ١ Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee Digital systems Digital systems are used in communication, business transactions, traffic control, spacecraft guidance, medical

More information

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value 1 Number System Introduction In this chapter, we will study about the number system and number line. We will also learn about the four fundamental operations on whole numbers and their properties. Natural

More information

The. Binary. Number System

The. Binary. Number System The Binary Number System Why is Binary important? Everything on a computer (or other digital device) is represented by Binary Numbers One to Five in various systems 1 2 3 4 5 I II III IV V 1 10 11 100

More information

Chapter 2: Number Systems

Chapter 2: Number Systems Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many

More information

1.1 Numbers system :-

1.1 Numbers system :- 1.1 Numbers system :- 1.3.1 Decimal System (0-9) :- Decimal system is a way of writing numbers. Any number, from huge quantities to tiny fractions, can be written in the decimal system using only the ten

More information

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude Chapter 2 Positional number systems A positional number system represents numeric values as sequences of one or more digits. Each digit in the representation is weighted according to its position in the

More information

Binary, Hexadecimal and Octal number system

Binary, Hexadecimal and Octal number system Binary, Hexadecimal and Octal number system Binary, hexadecimal, and octal refer to different number systems. The one that we typically use is called decimal. These number systems refer to the number of

More information

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes Multiple-byte data CMSC 313 Lecture 03 big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes UMBC, CMSC313, Richard Chang 4-5 Chapter

More information