How Computers Represent Information Yong Choi School of Business CSU, Bakersfield.

Slides:



Advertisements
Similar presentations
How to Convert Decimal Numbers to Binary EXAMPLES.
Advertisements

DATA REPRESENTATION CONVERSION.
Level ISA3: Information Representation
Agenda Shortcuts converting among numbering systems –Binary to Hex / Hex to Binary –Binary to Octal / Octal to Binary Signed and unsigned binary numbers.
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
Chapter 4.2 Binary numbers: Arithmetic
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Binary and Decimal Numbers
Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
2.1 2 Number Systems Foundations of Computer Science  Cengage Learning.
CPS-304 DIGITAL LOGIC & DESIGN Instructor : Ms. Saba Iqbal.
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information Technology Islamic.
Chapter 16 Binary and Hexadecimal Numbers. §16.2 thru 16.3 – Addition and Subtraction of Binary Numbers Binary = Base 2 Addition and subtraction are similar.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
A-Level Computing Data representation. Objectives Know how data can be represented in a computer system Understand the need for various forms of representation.
Numbering Systems CS208.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Why does it matter how data is stored on a computer? Example: Perform each of the following calculations in your head. a = 4/3 b = a – 1 c = 3*b e = 1.
HOW COMPUTERS MANIPULATE DATA Chapter 1 Coming up: Analog vs. Digital.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Binary Values and Number Systems
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
The Teacher CP4 Binary and all that… CP4 Revision.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
CPIT 201 Introduction to Computing
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
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
DECIMALBINARY a) b) c) d) e) f) Revision Exercise DECIMALBINARY a) b) c)
June 10, 2002© Howard Huang1 Number systems To get started, we’ll discuss one of the fundamental concepts underlying digital computer design:
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
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.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Computer Programming 12 Mr. Jean February 11 th, 2014.
MODULE –I NUMBER SYSTEM Digital Design Amit Kumar Assistant Professor SCSE, Galgotias University, Greater Noida.
ECE 362 Microprocessor Systems and Interfacing ©5-1 Lecture 1 Hexadecimal Computation Outline n Decimal n Binary n Octal n Hexadecimal.
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
Hexadecimal (base 16) BY MAT D. What is hexadecimal  Hexadecimal is a number system like binary or denary that has 16 characters, the numbers 0-9 and.
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
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.
CMSC 1041 Binary / Hex Binary and Hex The number systems of Computer Science.
Lecturer: Santokh Singh
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Digital Design Chapter One Digital Systems and Binary Numbers
Lec 3: Data Representation
Octal to Decimal Decimal Octal Binary Hexadecimal.
3.1 Denary, Binary and Hexadecimal Number Systems
Digital Systems and Number Systems
What is a byte? What is it? How would you use it?
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Lecture 3: Binary values and number systems
CHAPTER 1 : INTRODUCTION
Number Systems.
Number Systems.
Data Storage Introduction to computer, 2nd semester, 2010/2011
Number Systems and Binary Arithmetic
Number Systems Base 2, 10, 16.
Binary / Hex Binary and Hex The number systems of Computer Science.
Digital Electronics and Microprocessors
GCSE COMPUTER SCIENCE Topic 3 - Data 3.4 Hexadecimal Conversion.
Hexadecimal.
Beyond Base 10: Non-decimal Based Number Systems
Information Representation
COE 202: Digital Logic Design Number Systems Part 2
Presentation transcript:

How Computers Represent Information Yong Choi School of Business CSU, Bakersfield

Digital Storage Humans: decimal (or base 10) number system Computer: binary (base 2) number system On (“high” or 1) Off (“low” or 0) Each digit in a binary number is known as a bit and can have only one of two values, 0 or 1. One bit can store a number from 0 to 1 Two bits can store from 0 to 3 n bits can store numbers from 0 to 2 n

Binary Numbers Programmers often need to read numbers in the computer because the number of bits in calculation affects the accuracy and size limitations of numbers manipulated by the computer. So, it is useful to understand how the binary number system is used within the computer. In Java, programmer can declare a variable to be short (16 bits) and or long (64 bits) integer depending on the anticipated size of the number being used and required accuracy in calculations.

Advantages of Binary Numbers Simple Only two O and 1 Unambiguous and clear signals Analog signal vs. Digital signal Flawless copies can be made Anything (English, Spanish, Chinese) can be represented with patterns of bits

Hexadecimal Numbers Important!! Because it is commonly used as a shorthand notation for binary numbers. Each hexadecimal number exactly represent 4 binary bits. Most computers store and manipulate instructions and data using word sizes that are multiple of 4 bits. Colors in VB can be specified as a six-digit hexadecimal number. box/color.html box/color.html

Review of Decimal Numbers Decimal numbers are based on powers of 10. Mathematically, the number 537 can be calculated.. Similarly 9238 is

Converting Binary to Decimal Easy, just multiply digit by power of 2 Binary numbers are based on power of 2. Just like a decimal number is represented So, 101 binary is = 5 or = 5

Binary to Decimal Example = * *0 …………….. What is in decimal?

Converting Decimal to Binary A little more work than binary to decimal Find largest power-of-two smaller than decimal number Make the appropriate binary digit a ‘1’ Subtract the power of 2 from decimal Do the same thing again Some examples 3 = = 11 (that’s ) 5 = = 101 (that’s )

Decimal to Binary Example Convert 28 decimal to binary 28/2 = 12 ……. 0 12/2 = 10 ……. 0 10/2 = 5 ……… 0 5/2 = 4 ……….. 1 4/2 = 2 ……….. 0 2/2 = 1 ……….. 0 Answer:

Converting Hex to Binary Hexadecimal table DecBinHex DecBinHex a b c d e f

Hex to Binary Example 0010 Hex to Binary – just convert digits ac = No magic!! - remember each hex digit = 4 bits 2ac

Binary to Hex Just convert groups of 4 bits b = 537b 0101  0111  0011 

Hex to Decimal Just multiply each hex digit by decimal value, and add the results.  ac = 684 DecHex a 11b 12c 13d 14e 15f

Decimal to Hex Analogous to decimal  binary. 1. Find largest power-of-16 smaller than decimal number 2. Divide by power-of-16. The integer result is hex digit. 3. The remainder is new decimal number. 4. Do the same thing again

Decimal to Hex  DecHex a 11b 12c 13d 14e 15f /256 = 2 2__ 684/256 = /16 = 10 = a 2a_ 172/16 = 12 = c 2ac

Exercise Questions Convert decimal value 110 to Binary Hexadecimal Convert binary value to Decimal Hexadecimal Convert hexadecimal value 6CAD to Decimal Binary