IT-101 Section 001 Lecture #3 Introduction to Information Technology.

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

Thinking Mathematically
The Binary Numbering Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation in Computers
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.
The Binary Number System
Computer Systems 1 Fundamentals of Computing
Chapter 1 1 Number Systems. 2 Objectives  Understand why computers use binary (Base-2) numbering.  Understand how to convert Base-2 numbers to Base-
Representing Information in Binary (Continued)
Binary and Hexadecimal Numbers
Number Systems.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
Numbering Systems CS208.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
IT253: Computer Organization
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
1 Pertemuan 2 Network Math. Discussion Topics Binary presentation of data Bits and bytes Base 10 number system Base 2 number system Converting decimal.
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
Number Systems Ron Christensen CIS 121.
Chapter 7—Objects and Memory The Art and Science of An Introduction to Computer Science ERIC S. ROBERTS Java Objects and Memory C H A P T E R 7 Yea, from.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
1. Number Systems Chapt. 2 Location in course textbook.
EET 250 Number systems. Introduction to Number Systems While we live in a world where the decimal number is predominant in our lives, computers and digital.
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.
Data Representation, Number Systems and Base Conversions
How a Computer Processes Information. Java – Numbering Systems OBJECTIVE - Introduction to Numbering Systems and their relation to Computer Problems Review.
AEEE2031 Data Representation and Numbering Systems.
Announcement!!! First exam next Thursday (I’m trying to give you a first exam before the drop date) I’ll post a sample exam over the weekend and will try.
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
Presentation on Number System
IP Addressing is Logical Addressing It works on Network Layer (Layer 3) Two Version of Addressing Scheme IP version 4 – 32 bit addressing IP version 6.
Computer Number System
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
 2012 Pearson Education, Inc. Slide Chapter 4 NumerationSystems.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
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.
Number Systems and Codes
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
Introduction to Chapter 2
ITE102 – Computer Programming (C++)
Number System conversions
Chapter 1 Number Systems & Conversions
Number Systems and Codes
Numbering System TODAY AND TOMORROW 11th Edition
COMS 161 Introduction to Computing
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
AP Computer Science LESSON 1 on Number Bases.
Chapter Four Data Representation in Computers By Bezawit E.
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Chapter 2 Number Systems.
UNIT – 3 & 4. Data Representation and Internal
Chapter 3 - Binary Numbering System
Chapter 2 Number Systems.
Presentation transcript:

IT-101 Section 001 Lecture #3 Introduction to Information Technology

 Overview Chapter 3: Representing Information in Binary Form (cont..) Binary to decimal conversion Decimal to binary conversion

 Representing Information in Binary Form BInary digiTal symbols (BITs) form a universal language for any: Numbers Text Sound Images Video Anything else you can imagine… How is this possible???? How can numbers and text be represented in binary code????

How Do We Normally Represent Numbers? We normally don’t use Binary Digits (Bits) (in which a single placeholder can hold only 0 or 1) in everyday life. We use Decimal Digits - a single placeholder can hold one of ten numerical values between 0 and 9. Digits are combined together into larger numbers. For example: 8,234 is made up of 4 digits. The 4 holds the “1s place,” the 3 holds the “10s place,” the 2 holds the “100s place” and the 8 holds the “1000s place.” Before we discuss binary code, let’s think about the number system we use every day.

The Decimal System Decimal digits are combined to create larger numbers 4,567 => (4 x 10 3 ) + (5 x 10 2 ) + (6 x 10 1 ) + (7 x 10 0 ) 10 raised to the power of … 10 0 = = =10x10= =10x10x10=1, =10x10x10x10=10,000 and so on Also called Base-10 system There are other ways of representing numbers other than using the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. We have ten fingers and use ten digits! Coincidence?

Comparing the Decimal Number System to the Binary Number System While people routinely use decimal digits, computers use binary digits. The decimal system uses ten numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) to represent all values. The binary system uses two numbers (0 and 1) to represent all values. In other words, computers use the “base-2” system rather than the “base-10” system. Counting in binary is simple (different, but simple) because you use powers of two instead of ten. Example follows.

 Binary to Decimal Conversion The same as calculating the value of a decimal system number except use powers of two instead of powers of ten. The binary number 1101 can be converted to decimal as follows: (1x2 3 ) + (1x2 2 ) + (0x2 1 ) + (1x2 0 ) = = 13 The binary number 1101 can be converted to decimal as follows: (1x2 3 ) + (1x2 2 ) + (0x2 1 ) + (1x2 0 ) = = 13 For understanding binary, it’s helpful to have a good command of powers of 2: For understanding binary, it’s helpful to have a good command of powers of 2: 2 0 = = = 2x2 = = 2x2x2 = = 2x2x2x2 = = 2x2x2x2x2 = = 2x2x2x2x2x2 = = 2x2x2x2x2x2x2 = = 2x2x2x2x2x2x2x2 = = 2x2x2x2x2x2x2x2x2 = = 2x2x2x2x2x2x2x2x2x2 = 1024 and so on...

Binary versus Decimal Numbers 2s place 1s place 4s place 8s place Another Way to Think About It s place 10s place 1s place 100s place 1,000s place 9 5, ,000s place 9 x 10,000 = 90, x 1,000 = 5, x 100 = x 10 = x 1 = 7 _______________ = 95,107 (10) 1 x 16 = x 8 = x 4 = x 2 = x 1 = 1 _______________ = 21 (10) Decimal Number Binary Number

Another Example: Converting Binary to Decimal A computer generates the following sequence of bits: (2) How do we convert (2) into decimal? (1x2 5 ) + (1x2 4 ) + (0x2 3 ) + (1x2 2 ) + (0x2 1 ) + (1x2 0 ) (1x2 5 ) + (1x2 4 ) + (0x2 3 ) + (1x2 2 ) + (0x2 1 ) + (1x2 0 ) = = 53 (10) = = 53 (10) (2) = 53 (10)

Real World Example: The Internet Address An Internet address, known as an IP address for “Internet Protocol” is comprised of four binary octets, making it a 32-bit address. IP addresses, difficult for humans to read in binary format, are often converted to “dotted decimal format.” To convert the 32-bit binary address to dotted decimal format, divide the address into four 8-bit octets and then convert each octet to a decimal number. Each octet will have one of 256 values (0 through 255) Converting a 32-bit Internet address into dotted decimal format (IP address in dotted decimal form)

Real World Example: The Internet Address Convert the following 32-bit Internet address into dotted decimal format: ) Divide the IP address into four octets ) Convert each binary octet into a decimal number = = = 16+4 = = = = = 220 3) Write out the decimal values separated by periods

 Decimal to Binary Conversion Sometimes it can be done intuitively. For example: The decimal number 1 represented in 8-bit binary is: The decimal number 128 represented in 8-bit binary is: The decimal number 129 represented in 8-bit binary is: The decimal number 2 represented in 8-bit binary is: The decimal number 4 represented in 8-bit binary is: The decimal number 6 represented in 8-bit binary is: But what are we really doing mathematically?

Convert the Decimal Number 174 to a binary octet ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place Step 1: Compare 174 to >128 so place a 1 in the 128s place and subtract = 46 ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place 1 Step 2: Compare 46 to <64 so place a 0 in the 64s place and continue with 46. ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place 10

Reversing the Process: Converting a Decimal Number to Binary ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place Step 3: Compare 46 to >32 so place a 1 in the 32s place and subtract = 14 ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place 1 Step 4: Compare 14 to <16 so place a 0 in the 16s place and continue with 14. ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place Step 5: Compare 14 to 8. 14>8 so place a 1 in the 8s place and subtract 14-8=6. 101

____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place 0 Step 6: Compare 6 to 4. 6>4 so place a 1 in the 4s place and subtract 6-4= ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place 0 Step 7: Compare 2 to 2. 2=2 so place a 1 in the 2s place and subtract 2-2=0. There is no remainder left to convert, so also place a 0 in the 1s place ____ ____ ____ ____ 1s place 2s place 4s place 8s place 16s place 32s place 64s place 128s place The decimal number 174 has been converted to the binary number

Another Approach: Converting from Decimal to Binary Using BCD We can also simply represent one number at a time. How can we represent the ten decimal numbers (0-9) in binary code? Numeral BCD Representation We can represent any integer by a string of binary digits. For example, 749 can be represented in binary as:

Binary Conventions Most Significant Bit (MSB) and Least Significant Bit (LSB) Decimal Example: 64 6 is the Most Significant Digit 4 is the Least Significant Digit Binary: is the MSB 0 on the right is the LSB Subscripts: Note that the subscript “2” makes it clear a number is in binary format and the subscript “10” makes it clear a number is in decimal format. This avoids confusion between a number like which can either be binary, written as (2) or decimal, written as 110,101 (10)

If there is a “1” in the LSB of a binary number, then its decimal equivalent is an odd number If there is a “0” in the LSB of a binary number, then its decimal equivalent is an even number

In-Class Examples Convert 12 (10) to binary representation Convert (2) to decimal Convert 6234 (10) to “binary coded decimal” (BCD) representation Convert 256 (10) to binary representation Convert (2) to decimal

How Many Bits Are Necessary to Represent Something? 1 bit can represent two (2 1 ) symbols either a 0 or a 1 2 bits can represent four (2 2 ) symbols 00 or 01 or 10 or 11 3 bits can represent eight (2 3 ) symbols 000 or 001 or 011 or 111 or 100 or 110 or 101 or bits can represent sixteen (2 4 ) symbols 5 bits can represent 32 (2 5 ) symbols 6 bits can represent 64 (2 6 ) symbols 7 bits can represent 128 (2 7 ) symbols 8 bits (a byte) can represent 256 (2 8 ) symbols n bits can represent (2 n ) symbols! So…how many bits are necessary for all of us in class to have a unique binary ID? Are two bits enough? Three? Four? Five? Six? Seven?

To think about.. Can 64 bits represent twice as many symbols as 32 bits? 32 bit = 2 32 = 4,294,967,296 symbols 64 bit = 2 64 = 1.8 x symbols 128 bit = = 3.4 x symbols Can 8 bits represent twice as many symbols as 4 bits? 8 bit = 2 8 = 256 symbols 4 bit = 2 4 = 16 symbols Remember that we’re dealing with exponents! 8 bit is twice as big as __________? 7 bit! 7 bits can represent 2 7 possible symbols or 2x2x2x2x2x2x2 = bits can represent 2 8 possible symbols or 2x2x2x2x2x2x2x2 = 256

Exercises Convert the following to binary form: Convert the following to decimal form:

 Comments for next class Do the assigned exercises Topics to be covered next class: Bits vs. Bytes Representing real numbers in binary form Representing negative numbers in binary form Octal numbering system Hexadecimal numbering system Conversion between different numbering systems Representing alphanumeric characters in binary form