mod01 - 12-01-04 CS 230 - Winter 20121-1CS 230 Introduction...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
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 sandy.graham@uwaterloo.ca(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 dn1dn2dn3...d3d2d1dn1diriCS 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 dn1dn2dn3...d3d2d1dn1diriCS 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 510+3101+1102=1357+471+472+173=567216+3161+10162=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

This note was uploaded on 04/01/2012 for the course CS 230 taught by Professor Bb during the Spring '11 term at Waterloo.

Page1 / 36

mod01 - 12-01-04 CS 230 - Winter 20121-1CS 230 Introduction...

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

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