218L2S09 - ESE218 Lecture 2 Outline Number systems. Binary...

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

View Full Document Right Arrow Icon
1/29/2009 ESE218 Spring 2009 Lecture 2 1 ESE218 Lecture 2 Number systems. Binary arithmetic. Negative numbers Outline ± Number systems: Decimal vs Binary, Octal, Hexadecimal Decimal-to-Binary conversion ± Binary arithmetic ² Addition, subtraction, multiplication, division ± Negative numbers ² Signed magnitude ² Complement system ± Decimal integers with sign ² 10’s complements ² 9’s complements ± Binary integers with sign ² 1’s complements ² 2’s complements ± Summary
Background image of page 1

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

View Full DocumentRight Arrow Icon
1/29/2009 ESE218 Spring 2009 Lecture 2 2 Positional numbers systems. Decimal and binary digits. Binary Decimal 9 8 7 6 5 4 3 2 1 0 1 0 10 digits 2 digits 1 Bit = Bi nary digit <= Bit position defines the weight of bit 218 10 = 2 x 10 2 + 1 x10 1 + 8 x10 0 11011010 2 = 1x2 7 + 1x2 6 + 1x2 4 + 1x2 3 + 1x2 1 High voltage Low voltage Logical 1 Ù Logical 0 Ù Most digital systems utilize POSITIVE LOGIC: 7 6 5 4 3 2 1 0
Background image of page 2
1/29/2009 ESE218 Spring 2009 Lecture 2 3 Hex system for numbers and codes Hexadecimal Octal 7 6 5 4 3 2 1 0 F E D C B A 9 8 . . 2 1 0 8 digits 16 digits 3 3 2 218 10 = 0 1 1 0 1 1 0 1 0 2 = 332 8 = DA 16 13= D 10= A a two-digit Hex number represents 8 bits or1 Byte 3x2 6 +3x2 3 + 2x2 0 13x2 4 +10x2 0 …offers compact representation in program text and easy conversion to the binary form
Background image of page 3

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

View Full DocumentRight Arrow Icon
1/29/2009 ESE218 Spring 2009 Lecture 2 4 Binary number formats in PC Unsigned integers: 8 bits: 0…255 16 bits: 0…65535 2 8 -1 2 16 -1 Signed integers: 8 bits -127…127 16 bits: +32767 … -32767 Negative Sign occupies one digit position => the number range is ` twice shorter Floating point*: Single precision: 32 bits S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF 0 1 8 9 ……… 31 Sign - Exponent ( 8 bits ) - Mantissa (23 bits) Range: 2 -126 …2 127 up to ~10 38 Double precision: 64 bits for numbers up to ~10 308 *In this course we will work with integer numbers only
Background image of page 4
1/29/2009 ESE218 Spring 2009 Lecture 2 5 Kilo, Mega, Giga, Tera, Peta, Exa… 1024 10 512 9 256 8 128 7 64 6 32 5 16 4 8 3 4 2 2 1 2 n n 1 kB = 2 10 = 1024 B 1 GB = 2 30 = 1024 MB 1 TB =2 40 = 1024 GB 1 MB = 2 20 = 1024 kB = 1,048,576 B ~ Kilo in binary world means a bit more than just a thousand 10 3 10 6 10 9 10 12 10 15 10 18 1 PB =2 50 = 1024 TB 1 EB =2 60 = 1024 PB
Background image of page 5

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

View Full DocumentRight Arrow Icon
1/29/2009 ESE218 Spring 2009 Lecture 2 6 Decimal-to-Binary Conversion To be performed separately for integer and fractional parts Continuous division by 2 1. Starting from the LSB assign ± 0 if the remainder = 0 ± 1 if the remainder = 1 2. Discard the remainder and divide the result by 2 Continuous multiplication by 2 1. Starting from the MSB assign
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/12/2009 for the course ESE 218 taught by Professor Donetsky during the Spring '08 term at SUNY Stony Brook.

Page1 / 22

218L2S09 - ESE218 Lecture 2 Outline Number systems. Binary...

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

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