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

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

1 Chapter 2 The Digital World. 2 Digital Data Representation.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation Computer Organization &
Data Representation COE 205
Processing Data.
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Data Representation in Computers
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Binary and Decimal Numbers
Introduction to Information Technology
Number Systems & Logic Gates Day 1
Codes and number systems Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken ( ) and Harris & Harris (DDCA)
Representing Information in Binary (Continued)
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
© 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.
Lecture 1. Number Systems Prof. Taeweon Suh Computer Science Education Korea University ECM585 Special Topics in Computer Design.
Cosc175/data1 Data comprised of constants and variables information stored in memory Each memory location has an address Address - number identifying a.
Computers Organization & Assembly Language
Chapter 2 Computer Hardware
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
Fill in the blanks: (1) _________ has only two possible values 0 and 1. (2) There are __________bits in a byte. (3) 1 kilobyte of memory space can store.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
What is a computer? A computer is a device that:
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Computer Math CPS120: Lecture 3. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits have 0 or.
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.
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.
AEEE2031 Data Representation and Numbering Systems.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Data Representation.
* Numeral Systems: A writing method for expressing numbers is called a “Numeral System". In the most common numeral system, we write numbers with combinations.
ASCII AND EBCDIC CODES By : madam aisha.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Understanding Computers
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
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 Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Data Representation COE 308 Computer Architecture
Understanding binary Understanding Computers.
Number Systems and Codes
Data Representation ICS 233
Lec 3: Data Representation
Data Representation.
3.1 Denary, Binary and Hexadecimal Number Systems
CSCI 198: Lecture 4: Data Representation
CSCI 161: Lecture 4: Data Representation
Information Support and Services
What is Binary? Binary is a two-digit (Base-2) numerical system, which computers use to process and store data. The reason computers use the binary system.
COMP211 Computer Logic Design Lecture 1. Number Systems
Data Representation COE 301 Computer Organization
Information Representation
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
Chapter Four Data Representation in Computers By Bezawit E.
Data Representation ICS 233
LO1 – Understand Computer Hardware
Binary & Hex Review.
UNIT – 3 & 4. Data Representation and Internal
Data Representation COE 308 Computer Architecture
Presentation transcript:

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

 Overview Chapter 3: 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

 Bits vs. Bytes “Bits” are often used in terms of a data rate, or speed of information flow: 56 Kilobit per second modem (56 Kbps) A T-1 is Megabits per second (1.544 Mbps or 1544 Kbps) “Bytes” are often used in terms of storage or capacity-- computer memories are organized in terms of 8 bits 256 Megabyte (MB) RAM 40 Gigabyte (GB) Hard disk

Practical Use Everyday stuff measured in bits: 32-bit sound card 64-bit video accelerator card 128-bit encryption in your browser

Note! The Multipliers for Bits and Bytes are Slightly Different. When Referring to Bytes (as in computer memory) Kilobyte (KB) 2 10 = 1,024 bytes Megabyte (MB) 2 20 = 1,048,576 bytes Gigabyte (GB) 2 30 = 1,073,741,824 bytes Terabyte (TB) 2 40 = 1,099,511,627,776 bytes When Referring to Bits Per Second (as in transmission rates) Kilobit per second (Kbps) = 1000 bps (thousand) Megabit per second (Mbps) = 1,000,000 bps (million) Gigabit per second (Gbps) = 1,000,000,000 bps (billion) Terabit per second (Tbps) = 1,000,000,000,000 bps (trillion) “Kilo” or “Mega” have slightly different values when used with bits per second or with bytes.

More Multipliers for Measuring Bytes Kilobyte (K) 2 10 = 1,024 bytes Megabyte (M) 2 20 = 1,048,576 bytes Gigabyte (G) 2 30 = 1,073,741,824 bytes Terabytes (T) 2 40 = 1,099,511,627,776 bytes Petabytes (P) 2 50 = 1,125,899,906,842,624 bytes Exabytes (E) 2 60 = 1,152,921,504,606,846,976 bytes Zettabytes (Z) 2 70 = 1,180,591,620,717,411,303,424 bytes Yottabytes (Y) 2 80 = 1,208,925,819,614,629,174,706,176 bytes

 Representing Real Numbers in Binary Form Previously, we learned how to represent integers in binary form Real numbers can be represented in binary form as well We will illustrate this with a thermometer example: A Mercury thermometer reflects temperature that can continuously vary over its range of measurement (an analog device) A digital thermometer would require an infinite number of bits to accomplish the same thing So: if we are building a digital thermometer, we must make some choices and determine some parameters: Precision (number of bits we will use) vs. the cost Accuracy (how true is our measurement against a given standard)

What is the range we wish to measure? How many bits are we willing to use? Suppose we want to measure the temperature range: -40º F to 140º F Total measurement range = 180 º F If our thermometer measures in 0.01º increments, we need to represent 18,000 steps (There are 180 º degrees between -40 º to 140 ºF. Since each degree can have 100 different values, the number of possible values that the thermometer can measure is: 180x100=18,000) We can accomplish this with a 15 bit code (A 15 bit code can represent 2 15 =32,768 different values-since we have 18,000 different values we have to represent, a code with 14 bits will not suffice, as a 14-bit code can only represent 2 14 =16,384 values)

Thermometer Coding (One solution) 15 bit code

Thermometer Coding (Another solution)

 Representing Negative Numbers in Binary Form Negative numbers may also be represented in binary This may be accomplished a number of ways: The leftmost bit i.e.: MSB may be used to represent the sign. i.e.: 0 if positive, 1 if negative. ex: 1110 is a negative number because MSB is “1”. In decimal, this will correspond to -6. Positive 6 (+6) may then be represented by: 0110 There is a problem with this scheme in computer logic, because addition of these numbers in binary will result in: The result is not 0, it is: 4 10 with a 1 overflow Negative number Positive number overflow

This would cause errors in computing To overcome this problem, we can represent the negative number by using the 2’s complement notation: Take the complement (flip the bit values) of the positive number with the MSB as a sign bit (a 0 makes the representation positive) The binary complement of: 0110 is: 1001 Add a binary = 1010 (-6) The addition of the original number (+6) and it’s 2’s complemented value (-6) should give zero: Negative number Positive number – The result is 0, with a 1 overflow overflow Step1 Step2

Example: Express the decimal number -5 in 5-bit binary notation. First determine the 5-bit binary representation of 5: Then complement (change 1s to 0s and 0s to 1s) each bit: Finally, add 1: = in 2’s complement notation (To reverse the process take the complement and add 1!) Note that the 2’s complement of a 2’s complement of a number equals the original number.

In-class Examples Determine the 5-bit binary equivalent of -7 in 2’s complement notation and show how to reverse the process. Determine the decimal value of the 6-bit 2’s complement number given by

 Octal Numbering system There are other ways to “count ” besides the decimal and binary systems. One example is the octal numbering system (base 8). The Octal numbering system uses the first 8 numerals starting from 0 The first 20 numbers in the octal system are: 0,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17, 20 21,22,23 Because there are 8 numerals and 8 patterns that can be formed by 3 bits, a single octal number may be used to represent a group of 3 bits

Octal numeralBit pattern

For example, the number may be converted to octal form by grouping the bits into 3, and looking at the table. Starting from the right, count 3 digits to the left. The first 3-bits are: 111, corresponding to 7. The next 3-bits are: 010, corresponding to 2. The next are 001, corresponding to 1 and the last 3-bits are 101, corresponding to 5 Hence, the above binary number may be represented by: in octal form Start here

 Hexadecimal Numbering system The hex system uses 16 numerals, starting with zero The standard decimal system only provides 10 different symbols So, the letters A-F are used to fill out a set of 16 different numerals We can use hex to represent a grouping of 4 bits

DecimalOctalHexBinary A B C D E F1111

For example, the number may be converted to hexadecimal form by grouping the bits into 4, and looking at the table. Starting from the right, count 4 digits to the left. The first 4-bits are: 0111, corresponding to The next 4-bits are: 1101, corresponding to D 16. The last bits are: 1010, corresponding to A 16 Hence, the above binary number may be represented by: AD7 16 in hexadecimal form Start here

 Conversion between different numbering systems Conversions are possible between different numbering systems: 1-Binary to Decimal and vice versa 2-Binary to Octal and vice versa 3-Binary to Hex and vice versa 4-Octal to Decimal and vice versa 5-Hex to Decimal and vice versa 6-Octal to Hex and vice versa

We learned how to do # 1 in detail in the previous lecture We learned how to do # 2 and 3 in this lecture We will learn how to do # 4, 5 and 6 now

To convert octal and hex to decimal, we apply the same technique as converting binary to decimal. Remember that we summed together the weights of the various positions in the binary number which contained a “1” to convert from binary to decimal. Similarly, we sum the weights of the various positions in the octal or hex numbers depending on the base being used Remember that binary is base 2, octal is base 8 and hex is base 16 Two examples of octal to decimal coversion: 77 8 converted to decimal form: 7x8 1 +7x8 0 = converted to decimal form: 2x x8 2 +3x8 1 +5x8 0 = Two examples of hex to decimal coversion: A5 16 is converted to decimal form by: 10x x16 0 = F8C 16 is converted to decimal form by: 15x x x16 0 = To convert from octal to hex (or hex to octal), first convert octal (or hex) to binary, and then convert binary to hex (or octal).

 Representing Alphanumeric Characters in Binary form (ASCII) It is important to be able to represent text in binary form as information is entered into a computer via a keyboard Text may be encoded using ASCII ASCII can represent: Numerals Letters in both upper and lower cases Special “printing” symbols such $, %, etc. Commands that are used by computers to represent carriage returns, line feeds, etc

ASCII is an acronym for American Standard Code for Information Interchange Its structure is a 7 bit code (plus a parity bit or an “extended” bit in some implementations –ASCII can represent 128 symbols (2 7 symbols) –INFT 101 is: (decimal) or – in binary (using Appendix A) –A complete ASCII chart may be found in appendix A in your book –How do you spell Lecture in ASCII?

Extended ASCII Chart This ASCII chart illustrates Decimal and Hex representation of numbers, text and special characters Hex can be easily converted to binary Upper case D is is Upper case D is then in binary

Extended ASCII (Cont…) Another example: You want to represent the Yen sign (¥) From the table: 9D 9 16 = 9 10 = D 16 = = The ¥ sign in binary is:

ASCII conversion example Let us convert You & I, to decimal, hex and binary using the ASCII code table : Y: o: F u: Space: &: Space: I: ,: C

You & I, in Hex: 59 6F C You & I, in decimal: You & I, in binary:

Other Text Codes Extended Binary Coded Decimal Interchange Code (EBCDIC) used by IBM-- 8 bit (2 8 bits) 256 symbols Unicode is 16 bit (2 16 ) 65,536 symbols World Wide Web supports many languages Unicode supports Latin, Russian, Cherokee and other alphabet representations