lecture2

lecture2 - CS 211 Bits and Bytes Topics Why bits?...

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

View Full Document Right Arrow Icon
CS 211 Bits and Bytes Topics Topics & Why bits? & Representing information as bits ± Binary/Hexadecimal ± Byte representations » numbers » characters and strings » Instructions & Bit-level manipulations ± Boolean algebra ± Expressing in C & Integers
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 – 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 ± Floating point number cannot exactly represent $1.20 & Even carries through in scientific notation ± 1.5213 X 10 4 Implementing Electronically Implementing Electronically & Hard to store ± ENIAC (First electronic computer) used 10 vacuum tubes / digit & Hard to transmit ± Need high precision to encode 10 signal levels on single wire & Messy to implement digital logic functions ± Addition, multiplication, etc.
Background image of page 2
– 3 – 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 3

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

View Full DocumentRight Arrow Icon
– 4 – Byte-Oriented Memory Organization Byte-Oriented Memory Organization Programs Refer to Virtual Addresses Programs Refer to Virtual Addresses & Conceptually very large array of bytes & Actually implemented with hierarchy of different memory types ± SRAM, DRAM, disk ± Only allocate for regions actually used by program & In Unix and Windows NT, address space private to particular “process” ± Program being executed ± Program can clobber its own data, but not that of others Compiler + Run Compiler + Run -Time System Control Allocation Time System Control Allocation & Where different program objects should be stored & Multiple mechanisms: static, stack, and heap & In any case, all allocation within single virtual address space
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 & Hexadecimal 00 16 to FF 16 ± Base 16 number representation ± Use characters ‘0’ to ‘9’ and ‘A’ to ‘F’ ± Write FA1D37B 16 in C as 0xFA1D37B » Or 0xfa1d37b 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 – Machine Words Machine Words Machine Has “Word Size” Machine Has “Word Size” & Nominal size of integer-valued data ± Including addresses & Most current machines are 32 bits (4 bytes) ± Limits addresses to 4GB ± Becoming too small for memory-intensive applications & High-end systems are 64 bits (8 bytes) ± Potentially address 1.8 X 10 19 bytes & Machines support multiple data formats ± Fractions or multiples of word size ± Always integral number of bytes
Background image of page 6
– 7 – Word-Oriented Memory Organization Word-Oriented Memory Organization Addresses Specify Byte Addresses Specify Byte Locations Locations & Address of first byte in word &
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 63

lecture2 - CS 211 Bits and Bytes Topics Why bits?...

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