Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary number, Bits and Bytes and memory Sen Zhang.

Similar presentations


Presentation on theme: "Binary number, Bits and Bytes and memory Sen Zhang."— Presentation transcript:

1 Binary number, Bits and Bytes and memory Sen Zhang

2 Number systems –Decimal –Binary –Bits –bytes –Numbers conversion among different systems

3 Binary to Decimal To convert 1011 to its decimal value 1011 (It reads one zero one one in binary number) = 1000+0+10+1 = (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (1 * 2^0) = 8 + 0 + 2 + 1 = 11 (it reads eleven in decimal system) It is wrong to read 1011 one thousand and eleven, if you know it is a binary number.

4 Decimal to Binary Keep dividing the decimal number by 2 An Example to convert 237 10 to binary value 1 1 1 0 1 1 0 1 237 / 2 = 118 Remainder 1------------------------------------------------------| 118 / 2 = 59 Remainder 0---------------------------------------------------| | 59 / 2 = 29 Remainder 1------------------------------------------------| | | 29 / 2 = 14 Remainder 1------------------------------------------------| | | 14 / 2 = 7 Remainder 0---------------------------------------------| | | | 7 / 2 =3 Remainder 1------------------------------------------| | | | | 3 / 2 = 1 Remainder 1-----------------------------------| | | | | | | 1 / 2 = 0 Remainder 1--------------------------------| | | | | | | | v v v v v v v v 1 1 1 0 1 1 0 1 In the reversed order to get the result! The result!

5 The above two slides should be enough for you to prepare exam. However, you should proceed reading the rest of the slides for better understanding to binary system if you are interested in computing technology.

6 Number systems –Decimal –Binary –Bits –bytes –Numbers conversion among different systems

7 In this lecture, we will discuss bits and bytes, binary and decimal numbers in detail so that you will gain a fundamental understanding to their meanings and what these systems are and how they work. To help you understand, let's first review the well known decimal number system.

8 The Decimal Number System The decimal system is the base-10 system that we use every day. A number, say 6357, represented in the base-10 system consists of multiple ordered digits. (In other words, digits are normally combined together in groups to create larger numbers.) A digit is a single place that can hold numerical values between 0 and 9 (10 different values).

9 Let us start from an arbitrary decimal number For example, 6,357 has four digits. It is understood that in the number 6,357, –the 7 is filling the "1s place," –while the 5 is filling the 10s place, –the 3 is filling the 100s place –and the 6 is filling the 1,000s place. So you could express 6,357 this way if you want to be explicit: (6 * 1000) + (3 * 100) + (5 * 10) + (7 * 1) = 6000 + 300 + 50 + 7 = 6357 10^3

10 Continue.. Another way to express it would be to use the concept of powers of 10. A specific digit is associated with a specific weight expressed as powers of 10. The first digit (counting from the right) gives 10 to the 0 power, the second digit gives 10 to the 1 power, and so on.

11 Exponents are a shorthand way to show how many times a number, called the base, is multiplied times itself. A number with an exponent is said to be "raised to the power" of that exponent. Assuming that we are going to represent the concept of "raised to the power of" with the "^" symbol. "10 squared“ or 10 to the power of 2 is written as "10 ^2 " 10 to the fourth power is denoted 10 ^4

12 Thus, another way to express the previous number is like this: (6 * 10 ^3 ) + (3 * 10 ^2 ) + (5 * 10 ^1 ) + (7 * 10 ^0 ) = 6000 + 300 + 50 + 7 = 6357

13 But why do we human beings use 10 based number system?

14 How to count? Fingers and toes? Cuts on trunk? –11111111111111111111111 (23) –11111 (five) –1111111111111111111111111111(28) –11111111111111111 (17 ) Number system and calculating system –1, 2, …5 10, 11, … 23 –23+5=28 –23-5=17

15 The most commonly accepted explanation is that our base-10 number system was adopted by our ancestors most likely because we have 10 fingers. Interestingly enough, that is why digit in English also means a finger or toe.

16 We have reasons to ask a question in our minds: –“If we happened to evolve to have eight fingers instead, would we probably have a base-8 number system?” The answer is probably YES!

17 Any other number systems? The good news about number systems is that it is not the only choice to have 10 different values in a digit. Actually, we can have base-anything number systems from a theoretical point of view. There are many good reasons to use different bases in different situations. For example, 7 days/week, 12 months/year

18 A generalized rule The following rules apply to base 10 and to any other base number system: –The system of base n requires n different symbols or values. –The left most digit is the highest-order digit and represents the most significant digit, while the lowest-order digit is the least significant digit. –A digit is represented as powers of the system's base.

19 Computers happen to operate using the base-2 number system, also known as the binary number system, just like the base-10 number system is known as the decimal number system to human beings.

20 The fundamental point Modern computers use binary number system, in which there are only zeros and ones. (Only two symbols) A “bit” to binary is similar a “digit” to a decimal information. (Again, the easiest way to understand bits is to compare them to something you know: digits.) A bit has a single binary value, either 0 or 1.

21 Binary vs. Decimal Binary is a base two system which works just like our decimal system. Considering the decimal number system, it has a set of values which range from 0 to 9. The binary number system is base 2 and therefore requires only two digits, 0 and 1.

22 The fundamental point Binary representation of numbers and other information is the representation which can be understood by computer chips and can be saved in memory. It is important to computers because all computer data is ultimately represented by a series of zeros and ones, no matter you realize it or not.

23

24 Since the computer is really made up of tiny switches that can be either OFF or ON, you can look at a binary number as a series of light switches. A 1 represents a switch that is ON, and a 0 means a switch that is OFF.

25 Bits The binary number system uses binary digits (bits) in place of decimal digits. A binary number is composed of only 0s and 1s, like this: 1011. 1011 has four bits How do you figure out what the value of the binary number 1011 is in decimal world?

26 How does it work? As we have shown that our decimal system is based on place or location. That is, the place of each digit decides the value of that digit. The binary system works in exactly the same way, except that its place value is based on the number two.

27 What is the value of the binary number 1011? Therefore we have the one's place, the two's place, the four's place, the eight's place, the sixteen's place, and so on. Each place in the number represents two times (2X's) the place to its right. An example (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (1 * 2^0) = 8 + 0 + 2 + 1 = 11

28 decimal to binary Keep dividing the decimal number by 2 Ex 2 : 237 10 237 / 2 = 118 Remainder 1------------------------------------------------------| 118 / 2 = 59 Remainder 0---------------------------------------------------| | 59 / 2 = 29 Remainder 1------------------------------------------------| | | 29 / 2 = 14 Remainder 1------------------------------------------------| | | 14 / 2 = 7 Remainder 0---------------------------------------------| | | | 7 / 2 =3 Remainder 1------------------------------------------| | | | | 3 / 2 = 1 Remainder 1-----------------------------------| | | | | | | 1 / 2 = 0 Remainder 1--------------------------------| | | | | | | | v v v v v v v v 1 1 1 0 1 1 0 1 In the reversed order!

29 1 bit 1 byte 8 bits

30 A bit A ‘bit’ (from Binary + digIT) is the smallest unit of memory, also the unit of measurement of data information.

31 Bytes Since a single bit holds so little information, bits are rarely seen alone in computers. They are almost always bundled together into 8-bit collections, and these collections are called bytes. Bytes, larger units, then are treated as integral units of storage.

32 1 bit 1 byte = 8 bits 1 kb = 2 10 bytes = 1024 bytes !=1000 1 Mb = 1 k k bytes = 2 10 * 2 10 bytes 1 G b = 2 10 * 2 10 * 2 10 bytes 1 Terab = 2 10 * 2 10 * 2 10 * 2 10 bytes

33 Even larger capacity 1 petabyte = 2 10 * 2 10 * 2 10 * 2 10 * 2 10 bytes (2 to the 50th power ) 1 exabyte= 2 60 1 zettabyte = 2 70 1 yottabyte = 2 80

34 Some interesting facts about what these various-sized bytes can store: 1 bit: a binary decision 1 byte: a character 5 Megabytes: The complete works of Shakespeare 2 Gigabytes: 20 meters of shelved books 10 Terabytes: The printed collection of the US Library of Congress 200 Petabytes: All printed material in the whole word. 5 Exabytes: All words ever spoken by human beings

35 Memory Where to save binary numbers in computer? In memory! What is memory? Memory is a space where you can save binary values, consisting of a sequence of units (counted in bytes).

36 CPU processes binary number The first microprocessor to make it into a home computer was the Intel 8080, a complete 8-bit computer on one chip, introduced in 1974.

37 END


Download ppt "Binary number, Bits and Bytes and memory Sen Zhang."

Similar presentations


Ads by Google