MEng1052 Introduction to Computer and programming Debrebrhan University

Meng1052 introduction to computer and programming

This preview shows page 89 - 105 out of 130 pages.

MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 89
Positional number system Integers MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 90
Positional number system The following shows the place values for the integer +224 in the decimal system. Note that the digit 2 in position 1 has the value 20, but the same digit in position 2 has the value 200. Also note that we normally drop the plus sign, but it is implicit. MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile Examp le
Image of page 91
Reals Example 2.3 The following shows the place values for the real number +24.13.
Image of page 92
Positional number system The binary system (base 2) In this system the base b = 2 and we use only 2 symbols S = {0, 1} The symbols in this system are often referred to as binary digits or bits(binary digit). 8 bits = 1 byte 4 bytes = 1 word (in many systems) MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 93
2. 94 Integers Example The following shows that the number (11001) 2 in binary is the same as 25 in decimal. The subscript 2 shows that the base is 2.
Image of page 94
Reals Example The following shows that the number (101.11) 2 in binary is equal to the number 5.75 in decimal.
Image of page 95
Positional number system The hexadecimal system (base 16) In this system the base b = 16 and we use 16 symbols to represent a number. The set of symbol is S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F} Note that the symbols A, B, C, D, E, F are equivalent to 10, 11, 12, 13, 14, and 15 respectively. The symbols in this system are often referred to as hexadecimal digits . MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 96
2. 97 Integers The following shows that the number (2AE)16 in hexadecimal is equivalent to 686 in decimal. Example
Image of page 97
Positional number system The octal system (base 8) In this system the base b = 8 and we use 8 symbols to represent a number. The set of symbol is S = {0, 1, 2, 3, 4, 5, 6, 7} The symbols in this system are often referred to as octal digits . MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 98
2. 99 Integers Example The following shows that the number (1256) 8 in octal is the same as 686 in decimal.
Image of page 99
Conversion We need to know how to convert a number in one system to the equivalent number in another system. Since the decimal system is more familiar than the other systems, we first show how to covert from any base to decimal. Then we show how to convert from decimal to any base. Finally, we show how we can easily convert from binary to hexadecimal or octal and vice versa. MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 100
Decimal to any base
Image of page 101
Decimal to any base MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 102
Decimal to any base MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile The following shows how to convert 35 in decimal to binary. We start with the number in decimal, we move to the left while continuously finding the quotients and the remainder of division by 2. The result is 35 = (100011) 2 .
Image of page 103
Decimal to any base MEng1052 Introduction to Computer and programming Debrebrhan University By:Endrias Haile
Image of page 104
Image of page 105

You've reached the end of your free preview.

Want to read all 130 pages?

  • Spring '18
  • Endrias
  • Binary numeral system, Endrias Haile, Debrebrhan University

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes