Binary number, Bits and Byte IITG Project Team. Outline Defining the following terms from decimal counting system Positional weight Significance order,

Slides:



Advertisements
Similar presentations
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Advertisements

1 Chapter 2 The Digital World. 2 Digital Data Representation.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Computer Structures Lecture 2: Working with 0’s and 1’s.
Binary number, Bits and Bytes and memory Sen Zhang.
Binary number, Bits and Byte
Level ISA3: Information Representation
Information Processing Session 5B Binary Arithmetic Slide
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Assembly Language and Computer Architecture Using C++ and Java
EET 2261 Unit 2 HCS12 Architecture
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Binary and Decimal Numbers
Introduction to Information Technology
SIMS-201 Representing Information in Binary. 2  Overview Chapter 3: The search for an appropriate code Bits as building blocks of information Binary.
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
2.1 2 Number Systems Foundations of Computer Science  Cengage Learning.
Binary Arithmetic Math For Computers.
Real Numbers and the Decimal Number System
Data Representation in Computers
Data Representation Number Systems.
BLOCK DIAGRAM OF COMPUTER
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
Numbering systems.
Positional Number Systems
Numeral Systems Subjects: Numeral System Positional systems Decimal
CMPT 120 How computers run programs Summer 2012 Instructor: Hassan Khosravi.
Topics Introduction Hardware and Software How Computers Store Data
Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar.
Chapter P Prerequisites: Fundamental Concepts of Algebra
IT253: Computer Organization
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Data Representation.
Bits & Bytes Created by Chris McAbee For AAMU AGB199 Extra Credit Created from information copied and pasted from
Data Representation in Computer Systems. 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers.
How Computers Work … and how you can work them. Art 315 Lecture 03 Dr. J Parker Fall 2010.
Digital Logic Lecture 2 Number Systems
Topic 1 – Number Systems. What is a Number System? A number system consists of an ordered set of symbols (digits) with relations defined for addition,
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
Data Representation Conversion 24/04/2017.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Data Representation The storage of Text Numbers Graphics.
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
MECH1500 Chapter 3.
Basic Computer Organization Rashedul Hasan.. Five basic operation No matter what shape, size, cost and speed of computer we are talking about, all computer.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Number systems. Binary system. Bits and bytes. Modern computers “speak” in a digital language composed of 2 digits. The machine language of modern computers.
Unit 1 Introduction Number Systems and Conversion.
3.1 Denary, Binary and Hexadecimal Number Systems
Data Representation in Computer Systems
COMPUTING FUNDAMENTALS
Number System conversions
Machine Architecture and Number Systems
Information Representation
Fundamentals of Data Representation
Chapter Four Data Representation in Computers By Bezawit E.
Information Technology Department
Basic Computer Organization
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

Binary number, Bits and Byte IITG Project Team

Outline Defining the following terms from decimal counting system Positional weight Significance order, directional Powers Base Alphbet Binary numbers –Apply the above to binary system –Description of the binary counting system –Bit –Byte –Two ways conversion between decimal and binary, and decimal to the x-system –Special cases when x is 2 raised to certain integer power –ASCII A computer’s use of ASCII-American Standard Code for Information Interchange Hexadecimal numbers and codes –Explain what it is –Various counting systems are shown along with conversion

Learning Outcomes In this lecture, we will discuss bits and bytes, binary and decimal numbers in detail. You will gain a fundamental understanding about their meanings, what these systems are and how they work.

With one eye You can open and close

You have two eyes How many things you can represent?

Assume you have 4 eyes?

How about 8 eyes are available? How many things you can represent?

terms See outline

Outline Number systems –Decimal –Binary –Bits –bytes –Hexadecimal –Octal –Numbers conversion among different systems What is binary data? Binary system Where data is sent Binary language Machine language Computer language ASCII Summary Questions References How to measure the lengths of binary data Ascii code

What is Binary Data  Binary data is a computer’s language  Binary data is a combination of zeros and ones that are used to represent letters and numbers  It is the only type of data that can be directly understood by a computer.  We should also be able to read binary coded information.

Binary is the only language directly used by computers, so binary language is also referred to as machine language. Both data and machine instruction eventually need to be coded in binary too. It is the most fundamental level of information stored in a computer system. All of the data we use needs to be somehow converted into binary data in order for computer to use them.

Bits & Bytes? Have you ever heard of words bits and bytes? Have you heard of an advertisement that says, "This computer has a 64-bit Pentium IV processor with 256 mega-bytes of RAM and 100 giga-bytes of hard disk space." Probably the answer is yes, even for a normal computer user, not to mention you, a C++ programmer. Even not being a computer programmer, you should know what bits and bytes are and how to work with numbers expressed in binary and hexadecimal notations.

The Bit (binary digit) Bits are the 1’s and 0’s that allow us to represent, store, and manipulate data They are the smallest unit of data in a digital electronics device

The Bit Bits aren’t really 1’s and 0’s, they are devices that can be set to one of two states. –A bit can be a capacitor that is electronically charged or not charged. –A bit can be an area of metal particles on the surface of a disk that are either magnetically charged or not. –A bit can be a microscopic spot on a highly reflective disk surface that either has a pit burned into it or not.

The Bit How can a bit (an on-off switch) represent useful data and information? Information can be assigned to the two states of the bit: –On = –Off = 1 and 0 are typically used to describe the state of a bit, but you could use anything; black/white, true/false, male/female, etc.

00 = 01 = 10 = 11 = The Bit How many units of information could be represented with 2 bits?

The Bit How many units of information could be stored using 3 bits? 000 = 001 = 010 = 011 = 100 = 101 = 110 = 111 =

To help you understand more about binary system, let's first review the well known decimal number system.

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).

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) = = ^3

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.

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

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

What you can see from this expression is that each digit is a placeholder for the power of the index of that placeholder of base 10, starting from the least significant digit with 10 raised to the power of zero (i.e. counting from the rightmost digit). So far, you should all feel pretty comfortable -- we work with decimal digits every day.

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

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, maybe that is why digit in English also means a finger or toe.

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!

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

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.

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.

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.

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.

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.

You might ask Why don’t computers use the base-10 decimal system for numbers, counting and arithmetic? Why not 4 based, 7 based? Why 2 based?

We know that the computer doesn't have a real brain inside. In fact, it is made up mostly of semiconductor materials such as silicon. Yet, a computer acts in many ways as if it does have a real brain, because it can store (memorize) data and derive new information (operations) from the input data.

Why binary? These questions can be answered by a series of relevant questions! –How to store the values in hardware? –How to automatically perform arithmetic operations on numbers? –…

The fundamental question is can we find out a physical material to stably maintain n different status?

How to store? Advancement in material science guarantees that binary status can be represented with no ambiguity. Silicon and many other semiconductor materials can present one of two status at any given time, and can retain a status for a long time. Positive or negative, +5 volt or -5 volt. Think about 2 status in electronic world, if not One then Zero, very simple to implement in electronic world.

One the other hand, it is difficult, if not impossible, to find out a material to be able to maintain 10 different status stably. Generally speaking, the more status to maintain, the more difficult to find out such a material.

How to calculate Another factor is how to implement proper digital circuits to perform arithmetic and logical operations based on a specific number system. It turns out that the binary system is the preferred way to implement CPUs to do various operations (arithmetic and logical operations). Not any other systems!

You could wire up and build computers that operate in base-10 (assume physically we can find out such kind of material.), but they would be fiendishly expensive right now. On the other hand, base-2 computers are relatively cheap.

Also because there must always be at least two symbols for an information processing system to be able to distinguish significances of different values and to manipulate on them, binary is the smallest numbering system that supports definite arithmetic and logic operations.

The simplest answer is Basically speaking, binary system simplifies information representation and information processing in electronic world. Binary number system is the easiest one to implement from the hardware point of view. The binary number system suits a computer extremely well, because it allows simple CPU and memory designs. So computers use binary numbers.

Their CPU and memory are made up of millions of tiny “switches” that can be either ON or OFF. Two symbols, 0 and 1, can be used to stand for the two states of ON and OFF.

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.

The computer's CPU needs only recognize two states, in the same way as a switch must always be open or closed, or an electrical flow on or off, a binary digit must always be one or zero. –on or off, –Yes or no, –1 or 0. But from this on-off, yes-no 1-0 state, all things may can be represented completely and calculated correctly.

What is a feasible number system? Should be able to represent any information. Should be able to support arithmetic and logic operations.

Binary numbers 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: How do you figure out what the value of the binary number 1011 is in decimal world?

How does this type of number system 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.

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) = = 11

How you count or add in decimal? Considering the decimal number system, it has a set of values which range from 0 to 9. If you add 1 to 9, carry will happen. X + Y is greater than 10 and carry 1 onto the next column on the left. If the sum is less than 10, put it down at the bottom and set the carry to zero. If it is not less than the base, subtract 10, put down the result, and set the carry to one.

You can see that in binary numbers, each bit holds the value of increasing powers of 2. That makes counting in binary pretty easy. With only two numerals, 1 (one) and 0 (zero), counting in binary is pretty simple. Just keep in mind the following: = = = = 10 When you look at this sequence, –0 and 1 are the same for decimal and binary number systems. –As for the decimal number 2, you see for the first time carrying takes place in the binary system. If a bit is 1, and you add 1 to it, the bit becomes 0 and the next bit becomes 1.

Binary data Starting at zero and going through 12, counting in decimal and binary have been listed on the previous slide. Please also notice that, in the transition from decimal 11 to decimal 12, the carrying effect rolls over through 2 bits, turning 1011 into 1100.

Binary data 0 = 0 1 = 1 2 = 10 3 = 11 4 = = = = = = = = = 1100

Binary data Decimal Number Binary Number This table shows how a base 10 number would be represented in binary code.

decimal to binary Keep dividing by 2 Ex 2 : / 2 = 118 Remainder | 118 / 2 = 59 Remainder | | 59 / 2 = 29 Remainder | | | 29 / 2 = 14 Remainder | | | 14 / 2 = 7 Remainder | | | | 7 / 2 =3 Remainder | | | | | 3 / 2 = 1 Remainder | | | | | | | 1 / 2 = 0 Remainder | | | | | | | | v v v v v v v v

Binary arithmetic operation Look at adder in binary and decimal = =110 (carry) which is 6 in decimal.

How to add two numbers which are not necessarily base 10 Start with the rightmost column of digits (be sure the numbers are properly aligned with units digits under each other). Begin with carry zero. Add the digits in the current column plus the carry. If the sum is less than the base, put it down at the bottom and set the carry to zero. If it is not less than the base, subtract the base, put down the result, and set the carry to one. If you are not out of columns, move to the next one to the left, and go back to step c above. If the carry is not zero, write it down as the leftmost digit of the sum. Stop.

More binary operations Likewise, other arithmetic operations such as subtraction, multiplication and division, as well as other logical operations can all be accomplished electronically in CPUs, but more complicated than binary adder. You just need to know that binary numbers can represent everything, support a complete set of arithmetic and logic operations. (Not the concentration of this class, take introduction to computer science or architecture course if want to explore more such as binary complementary code etc.!)

As you can see, numbers can become rather long and appear to be cumbersome in the binary system. For example, to show the number 10, we need four light switches, or four places. However, it is not a problem to computers at all! Because the real switches inside a computer are tiny and they are able to turn on and off very rapidly. The reduction of decimal to binary does increase the length of the number, a lot, but binary allows simple CPU design.

The Hexadecimal System Although not a problem internally, long binary numbers seem to be a problem when they are displayed in most situations. A common practice to solve this problem is to use hexadecimal to represent Binary numbers more compactly externally. The hexadecimal system is base 16. Therefore, it requires 16 different symbols. The values 0 through 9 are used, along with the letters A through F, which represent the decimal values 10 through , A, B, C, D, E, F 0..9, 10, 11, 12,13, 14, 15

Hexadecimal binary binaryHexadecimal A 1011B 1100C 1101D 1110E 1111F Here is an example of a hexadecimal number and its binary equivalent

Hexdecimalbinary F FF

Hexadecimal binary Group binary number 4 by 4 starting from the least significant position. 11,1101,10013D , ED

The Octal System The Octal system is base 8. Therefore it requires 8 digits. The values 0 through 7 are used. Octal to hexadecimal conversion, or visa versa, is most easily performed by first converting to binary.

A binary number is converted to octal by grouping the bits in groups of three. 1 1,1 0 1,

The binary, hexadecimal (hex) and octal system share one common feature – they are all based on powers of 2. Each digit in the hex system is equivalent to a four-digit binary number and each digit in the octal system is equivalent to a 3-digit binary number.

1 bit 1 byte 4 bytes = 1 word System dependent.

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

Bits and bytes Each binary digit is called a bit A bit can be a zero or a one To represent more than two values a person needs to use multiple bits One byte represents eight bits It can have 256 different values

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.

Words One most machines, bytes are assembled into larger structures called words, where a word is usually defined to be the size required to hold an integer value. Some machines use two-byte words (16 bits), while some use 4-byte words(32 bits) and some machine uses less conventional sizes.

Why are there 8 bits in a byte? A similar question is, "Why are there 12 eggs in a dozen?“ Why your table has no larger or smaller working area? It targets at the most common situation. The 8-bit byte is something that people settled on through trial and error over the past 50 years. To some extend, 8-bit is enough to represent all English characters and Arabic numbers. A byte used to be the basic unit used to hold an individual character in a text document.

One question? Can you use your two eyes to represent four directions, north, east, south and west to your partner. Hint: you can open and close your eyes to code different information.

With 8 bits in a byte, you can represent 256 values ranging from 0 to 255, as shown here: 0 = = = = = This is related to ASCII code!

1 bit 1 byte = 8 bits 1 kb = 2 10 bytes = 1024 bytes != 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

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

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

Both RAM and hard disk capacities are measured in bytes, as are file sizes when you examine them in a file viewer.

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.

PC market moved from the 8088 to the 80286, the 80386, 80486, the Pentium, the Pentium II to the Pentium III to the Pentium 4. All of these microprocessors are made by Intel and all of them are improvements on the basic design of the The Pentium 4 can execute any piece of code that ran on the original 8088, but it does it about 5,000 times faster!

Questions Alexandra Reichert  How is binary data represented?  In a combination of zeros and ones  What can be represented in binary?  Any number or letter

Binary humor In binary code “10” translates to the number “2” 3/17/2016Binary Data84

 Why do computer programmers confuse Halloween and Christmas? –Answer: Because oct31=dec25. –Explanation: octal (oct) value of 31 = decimal (dec) 25

References ASCII. (2014, September 5). Retrieved from Wikipedia: Zandbergen, P. (Binary Language of Computers: Definition, Lesson, and Quiz. Retrieved from Education Portal: portal.com/academy/lesson/binary-language-of-computers- definition-lesson-quiz.html#lessonhttp://education- portal.com/academy/lesson/binary-language-of-computers- definition-lesson-quiz.html#lesson