13.07.2015 Views

Introduction to Computer Engineering – EECS 203

Introduction to Computer Engineering – EECS 203

Introduction to Computer Engineering – EECS 203

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>http://ziyang.eecs.northwestern.edu/ ∼ dickrp/eecs<strong>203</strong>/Instruc<strong>to</strong>r: Robert DickOffice: L477 TechEmail: dickrp@northwestern.eduPhone: 847–467–2298TA: Neal OzaOffice: Tech. Inst. L375Phone: 847-467-0033Email: nealoza@u.northwestern.eduTT: David BildOffice: Tech. Inst. L470Phone: 847-491-2083Email: d-bild@northwestern.edu


OutlineNumber SystemsHomework1. Number Systems2. Homework2 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Number SystemsHomework<strong>Introduction</strong> <strong>to</strong> number systemsConsider a base-10 number: 1,2931, 293 = 1 · 10 3 + 2 · 10 2 + 9 · 10 1 + 3 · 10 0For base-10, given an n-digit number in which d i is the ith digit, thenumber isn∑10 i−1 · d ii=03 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Number SystemsHomework<strong>Introduction</strong> <strong>to</strong> number systemsThis works for any base. Convert 2, 012 3 from base-3 <strong>to</strong> base-10.2 · 3 3 + 0 · 3 2 + 1 · 3 1 + 2 · 3 02 · 27 + 0 · 9 + 1 · 3 + 2 · 154 + 0 + 3 + 259 104 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Number SystemsHomework<strong>Introduction</strong> <strong>to</strong> number systemsConvert 59 10 from base-10 <strong>to</strong> base-3. Repeatedly divide by thegreatest power of b (the base) that is less than the number.Remainder Try dividing Digit Comment59 3 4 = 81 0 Too big59 − 0 · 81 = 59 3 3 = 27 2 O.K.59 − 2 · 27 = 5 3 2 = 9 0 Too big5 − 0 · 9 = 5 3 1 = 3 1 O.K.5 − 1 · 3 = 2 3 0 2 O.K.02012 3 = 2012 35 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Number SystemsHomeworkConversion works for any baseReview: For base-10, given an n-digit number in which d i is the ithdigit, the number isn∑10 i−1 · d ii=1For base-b, given an n-digit number in which d i is the ith digit, thenumber isn∑·b i−1 · d ii=16 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Useful basesNumber SystemsHomework2: Also called binary. Most fundamental base in digital logic.Know this like the back of your hand.8: Also called octal. Sometimes used by programmers. Preferbase 16.10: Also called decimal or Arabic.16: Also called hexadecimal or simple hex. One of the mostcompact and beautiful representations for digital computerprogrammers.7 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


BinaryNumber SystemsHomework1 2 4 8 16 32 64 128 256 512 1,024 (1K)2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10k ≠ K1 k = 10 3 = 1,0001 K = 2 10 = 1,0248 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


DecimalNumber SystemsHomeworkMost commonly used by human beings.Also called Arabic.Actually developed in India and brought <strong>to</strong> Europe via Arabianempire.Largely replaced Roman numerals, which were more cumbersomewhen writing the large and complicated numbers used inastronomy and wide-spread trade.9 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Number systemsNumber SystemsHomeworkRepresentation of positive numbers same in most systemsA few special-purpose alternatives exist, e.g., Gray codeAlternatives exist for signed numbers10 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Base-16: HexNumber SystemsHomework0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150 1 2 3 4 5 6 7 8 9 A B C D E FOften prefixed with 0x.What is 0xFF?11 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


OutlineNumber SystemsHomework1. Number Systems2. Homework12 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Number SystemsHomeworkReading assignmentM. Morris Mano and Charles R. Kime. Logic and <strong>Computer</strong>Design Fundamentals. Prentice-Hall, NJ, third edition, 2004Sections 5.1–5.613 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>


Number SystemsHomework<strong>Computer</strong> geek culture referenceSpelling things in ASCII (hex or binary)This is one of the lower forms of geek culture, akin <strong>to</strong> bad punsHowever, at least one university has things written in<strong>to</strong> itsbuildings with subtle brick patterns in ASCII binary4a6934207375616e34206a69312073686534206a69342068656e332068616f332077616e322114 R. Dick <strong>Introduction</strong> <strong>to</strong> <strong>Computer</strong> <strong>Engineering</strong> – <strong>EECS</strong> <strong>203</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!