LN2-DataRep

LN2-DataRep - FIT1001- Computer Systems Lecture Notes 2...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 www.monash.edu.au www.monash.edu.au FIT1001- Computer Systems Lecture Notes 2 Data Representation and Computer Arithmetic LN 2: FIT1001 Computer Systems 3 LN 2: Learning Objectives Number systems Methods of storage used for binary data Representation of integer, floating point and character data Conversion methods for integer, signed integer and floating-point numbers Basic mathematical operations on signed integer and floating-point numbers www.monash.edu.au Number Systems
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 LN 2: FIT1001 Computer Systems 5 Binary and Decimal Binary number system (base 2) – uses powers of 2 for each position in a number Decimal number system (base 10) – uses powers of 10 for each position in a number Any integer quantity can be represented exactly using any base (or radix) – The decimal integer 947 in powers of 10: >9 × 10 2 + 4 × 10 1 + 7 × 10 0 – The binary number 11001 in powers of 2 is: >1 × 2 4 + 1 × 2 3 + 0 × 2 2 + 0 × 2 1 + 1 × 2 0 > 16 + 8 + 0 + 0 + 1 = 25 When the radix is something other than 10, the base is denoted by a subscript – 11001 2 = 2510 (Sometimes, the subscript 10 is added for emphasis) LN 2: FIT1001 Computer Systems 6 Octal and Hexadecimal Octal (base 8) – uses 8 symbols 0, 1, 2, 3, 4, 5, 6 and 7 to denote values from 0 to 7 Hexadecimal (base 16) – uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F to denote values from 0 to 15 – represents a shorthand version of binary numbers – Example: 15528 10 = 3CA8 16 Base-2 and base-16 number systems enable you to understand the operation of computer components and the design of instruction set architectures LN 2: FIT1001 Computer Systems 7 Binary, Hexadecimal and Octal It is easy to convert between – base 2 and base 16 – base 2 and base 8 To convert from binary to hexadecimal – Group the binary digits into groups of four > From right to left for integer part / left to right for fraction part > Important to pad out with 0’s (to avoid errors) – Example: convert the binary number 11010100011011 2 (= 13595 10) to hexadecimal To convert from binary to octal – Group the binary digits into groups of three > From right to left for integer part / left to right for fraction part > Important to pad out with 0’s (to avoid errors) – Example: convert the binary number 11010100011011 2 to octal LN 2: FIT1001 Computer Systems 8 Binary Number System: Integers Uses 2 symbols: – 0 and 1 – Highest digit is 2-1 Example: the binary number 11001 in powers of 2 is: –1 × 2 4 + 1 × 2 3 + 0 × 2 2 + 0 × 2 1 + 1 × 2 0 = 25 – The powers of 2 increase from right to left A simple algorithm for calculating the successive binary digits of a decimal integer X: – Start from the right hand end: > Repeat – Get the remainder from dividing X by 2 – Divide X by 2 and put the result in X > until X is zero (the quotient = 0) – The remainders in reverse order are the binary value Example: Calculate the binary digits for X = 43 10
Background image of page 2
3 LN 2: FIT1001 Computer Systems 9 Binary Number System: Fractions (I) Binary fractions involve descending powers of 2 A simple algorithm for calculating the successive binary
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 26

LN2-DataRep - FIT1001- Computer Systems Lecture Notes 2...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online