{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

mod01

# mod01 - CS 230 Winter 20121-1CS 230 – Introduction to...

This preview shows pages 1–8. Sign up to view the full content.

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 12-01-04 CS 230 - Winter 20121-1CS 230 – Introduction to Computers and Computer Systems Module 1 – Arithmetic, Hardware, Data Sandy Graham [email protected](Slides based on materials prepared by Martin Karsten) CS 230 - Winter 20121-2Overview number representation boolean algebra and gate logic integer arithmetic non-numerical data types floating point 12-01-04 CS 230 - Winter 20121-3Number Representation radix representation radix also know as base writing natural numbers using a finite alphabet given an n-digit word in base r integer value is dn−1dn−2dn−3...d3d2d1d∑n−1di⋅riCS 230 - Winter 20121-4Radix Representation humans: base-10, decimal why? computers: base-2, binary why? electrical simplicity ¡analog/digital conversion (high vs. low voltage) low-level decimal conversion? ¡storage expansion / waste 12-01-04 CS 230 - Winter 20121-3Number Representation radix representation radix also know as base writing natural numbers using a finite alphabet given an n-digit word in base r integer value is dn−1dn−2dn−3...d3d2d1d∑n−1di⋅riCS 230 - Winter 20121-4Radix Representation humans: base-10, decimal why? computers: base-2, binary why? electrical simplicity ¡analog/digital conversion (high vs. low voltage) low-level decimal conversion? ¡storage expansion / waste 12-01-04 CS 230 - Winter 20121-5Examples 135dec not too surprising... 1440sep A32hex use letters A...F to express digits > 9 5⋅10+3⋅101+1⋅102=135⋅7+4⋅71+4⋅72+1⋅73=5672⋅16+3⋅161+10⋅162=2610CS 230 - Winter 20121-6Conversion from Decimal repeatedly divide by target base remainders generate digits from right to left... example: 3219dec = C93hex 3219/16=201R3201/16=12R912/16=R1212-01-04 CS 230 - Winter 20121-7Binary Numbers only 0 and 1 as digits example 11101100bin permits simple binary operations 22+23+25+26+27=236CS 230 - Winter 20121-8Binary / Hex Conversion 0000bin= 0hex 0001bin= 1hex 0010bin= 2hex 0011bin= 3hex ... 1111bin= Fhex 12-01-04 CS 230 - Winter 20121-9Binary Addition textbook procedure add digits right to left include carry-over fixed width n-bit representation: overflow modular arithmetic 4 bits: 14 + 4 = 2 CS 230 - Winter 20121-10Boolean Algebra algebra to express binary logic basic operators: OR, AND, NOT like normal elementary algebra addition – OR multiplication – AND negation – NOT identity, zero, inverse, commutative, associative models electronic circuits with relays 12-01-04 Truth Tables and Gates OR X Y Result X ˮY 0 0 0 X + Y 0 1 1 1 0 1 1 1 1 AND X Y Result X ˭Y 0 0 0 X * Y 0 1 0 1 0 0 1 1 1 NOT X Result ¬ X 0 1 1 0 CS 230 - Winter 20121-11CS 230 - Winter 20121-12Other Rules Distributive Law A * (B + C) = A * B + A * C A ˭(B ˮC) = A ˭B ˮA ˭C De Morgan's Law ¬ (A ˮB) = ¬A ˭¬B ¬ (A ˭B) = ¬A ˮ¬B 12-01-04 CS 230 - Winter 20121-13EXCLUSIVE OR...
View Full Document

{[ snackBarMessage ]}

### Page1 / 36

mod01 - CS 230 Winter 20121-1CS 230 – Introduction to...

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

View Full Document
Ask a homework question - tutors are online