lecture2 - CIS 450 Computer Architecture and Organization...

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

View Full Document Right Arrow Icon
CIS 450 Computer Architecture and Organization Lecture 2: Data Representation Mitch Neilsen Mitch Neilsen [email protected] [email protected] 219D Nichols Hall 219D Nichols Hall
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– Topics Topics Representing information as bits Representing information as bits Bit Bit -level manipulations level manipulations ± Boolean Algebra ± Expressing in C Representation of Integers Representation of Integers ± Basic Properties and Operations ± Implementation in C/C++
Background image of page 2
–3– Why Don’t Computers Use Base 10? Why Don’t Computers Use Base 10? Base 10 Number Representation Base 10 Number Representation ± That’s why fingers are known as “digits” ± Natural representation for financial transactions z Floating point number cannot exactly represent $1.20 ± Even carries through in scientific notation z 1.5213E4 does not exactly represent 1.5213 X 10 4 Implementing Electronically Implementing Electronically ± Hard to store z ENIAC (First electronic computer) used 10 vacuum tubes / digit ± Hard to transmit z Need high precision to encode 10 signal levels on single wire ± Messy to implement digital logic functions z Addition, multiplication, etc.
Background image of page 3

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

View Full DocumentRight Arrow Icon
–4– Binary Representations Binary Representations Base 2 Number Representation Base 2 Number Representation ± Represent 15213 10 as 11101101101101 2 ± Represent 1.20 10 as 1.0011001100110011[0011]… 2 ± Represent 1.5213 X 10 4 as 1.1101101101101 2 X 2 13 Electronic Implementation Electronic Implementation ± Easy to store with bistable elements ± Reliably transmitted on noisy and inaccurate wires 0.0V 0.5V 2.8V 3.3V 0 1 0
Background image of page 4
–5– Encoding Byte Values Encoding Byte Values Byte = 8 bits Byte = 8 bits ± Binary 00000000 2 to 11111111 2 ± Decimal: 0 10 to 255 10 z First digit must not be 0, for non-zero values in C ± Hexadecimal 00 16 to FF 16 z Base 16 number representation z Use characters ‘0’ to ‘9’ and ‘A’ to ‘F’ z Write FA1D37B 16 in C as 0xFA1D37B » Or 0xfa1d37b ± Octal 000 8 to 377 8 z Base 8 number representation z Represented with first digit 0. 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 8 1000 9 9 1001 A 10 1010 B 11 1011 C 12 1100 D 13 1101 E 14 1110 F 15 1111 H e x D c i m a l B n r y
Background image of page 5

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

View Full DocumentRight Arrow Icon
–6– Dec ÅÆ Bin Dec ÅÆ Bin Decimal to Binary ± Divide by two until you have a binary number; the remainders (in reverse) are the binary equivalent ± Example: 29 ± 29 / 2 = 14 R 1 ± 14 / 2 = 7 R 0 ± 7 / 2 = 3 R 1 ± 3 / 2 = 1 R 1 ± 1 / 2 = 0 R 1 ± Binary: 1 1 1 0 1
Background image of page 6
–7– Dec ÅÆ Bin Dec ÅÆ Bin Binary to Decimal ± Add powers of two: ± 11101 = 1 *2 4 + 1 *2 3 + 1 *2 2 + 0 *2 1 + 1 *2 0 ± 16 + 8 + 4 + 1 ± 29
Background image of page 7

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

View Full DocumentRight Arrow Icon
–8– Oct ÅÆ Bin Oct ÅÆ Bin Binary to Octal, Octal to Binary Each octal digit is represented by 3-bits: 0 ~ 000 4 ~ 100 1 ~ 001 5 ~ 101 2 ~ 010 6 ~ 110 3 ~ 011 7 ~ 111
Background image of page 8
–9– Octal Example: Unix File Perms Octal Example: Unix File Perms Three fields: ± User ± Group ± Other Each field consists of: ± 0b100 = Read bit ± 0b010 = Write bit ± 0b001 = Execute bit Example: ls –l /pub/fun total 176 -rw-r--r-- 1 root root 4055 May 13 1993 Unix-hoax -rwxr-xr-x 1 root root 6506 Dec 7 1994 evolve -rw-r--r-- 1 root root 13449 Oct 12 1988 halloween_story
Background image of page 9

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

View Full DocumentRight Arrow Icon
–10– Unix File Perms Unix File Perms Examples: ± chmod 644 Unix-hoax ± chmod 755 evolve ± chmod 640 file.html ± chmod 644 file.html
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/09/2008 for the course CIS 450 taught by Professor Neilsen,mitch during the Spring '08 term at Kansas State University.

Page1 / 52

lecture2 - CIS 450 Computer Architecture and Organization...

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

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