Data
- (Some repeating CS1083, ECE course)
- bits and bit sequences
- integers (signed and unsigned)
- bit vectors
- strings and characters
- floating point numbers
- hexadecimal and octal notations
Data (Some repeating CS1083, ECE course) bits and bit sequences - - PowerPoint PPT Presentation
Data (Some repeating CS1083, ECE course) bits and bit sequences integers (signed and unsigned) bit vectors strings and characters floating point numbers hexadecimal and octal notations Bits and Bit Sequences
– halfword: 16 bits – word: 32 bits
protects)
is a bitvector that keeps my office hours for the first 10 days (only). Later in month, all days are painted false.
to the += operator you may already love.
– Alt1: add 2k-1 before the arithmetic shift, if dividend is
– Alt2: (branchless – faster on many modern CPUs)
– every bit but leftmost moves left 1. The leftmost bit circles
know how many characters I need to store, I know precisely how many bytes it will cost me.
are rare. Codepoints from 0-127 (“ASCII”) are very common.
need 2 more. Not a fixed-width encoding.
bytes, and weird codes with 4.
that can be “UTF-8” or “UTF-16” etc. Otherwise, it uses the operating system's default.
= +1 * (1 + 3/16) * 2-67
– 1 sign bit – 11 exponent bits, bias 1023 – 52 fraction digits stored
– an operation code (opcode) that indicates which of the supported operations
is desired
– codes indicating addressing modes that provide the input data (“operands”) – code indicating where the result should be put – code indicating the conditions under which the instruction should be ignored
– numbers have few digits – it's easy to convert to/from binary
– Digit 7 has value seven, just like decimal – Digit A has value ten, B has value eleven, …
F has value fifteen
– the 9 expands to 1001 – the A expands to 1010 – the 4 expands to 0100
– don't memorize: just use the values of digits – you carry and borrow 16, not 10