FIT1047 Study Guide - Final Guide: Cyclic Redundancy Check, Checksum, Negative Number

66 views2 pages
Representing Numbers
Representing Numbers
In computers, everything is represented by 0 and 1
When we see a number (365), we use the decimal system to interpret it.
o We see 365 as 300 + 60 + 5
Computers work with only two different symbols - high voltage and low voltage
o Sometimes defining power on and power off
o These are the 0 and 1's
Binary Numbers
Similar to decimal system, but rather than being 10x as much for each position, it is 2x as much
101101101
o 2^8 + 0 + 2^6 + 2^5 + 0 + 2^3 + 2^2 + 0 + 2^0
o = 256 + 0 + 64 + 32 + 0 + 8 + 4 + 0 + 1
o = 365
Addition:
o Same as decimal addition. 1 + 1 = 0 (with a carry of 1)
o 1101 + 11 = 1000
Conversions
o Ex. 365
o Find largest power of 2 that is closest to 365. (2^8 = 256) 1xxxxxxxx
o 365 - 256 = 109. Find largest power of 2 that is closest to 109. (2^6 = 64). Add a 0 for the
2^7. 101xxxxxx
o Keep going until you reach 0
Bites, Bytes and Words
A bit is a single binary digit (0 or 1)
8 bits is a byte
A fixed width of a collection of bits is a word.
o Often 16, 32 or 64 bits
Hexadecimal Numbers
Base 16
4 bits
0 - 9 is numbers. 10 - 15 is letters A to F
Text to Binary
ASCII is most common encoding that computers use (7 bits)
Assigns each possible character to a fixed bit
Nowadays, ASCII is not enough for all characters of different languages. Hence UNICODE is
used. (32 bits)
Each character corresponds to 32 bits. (Large amount of storage required)
UTF-8 uses 8 bits per character
UTF-16 uses 16 bits per character
Negative Binary Numbers
Sign and Magnitude
Leftmost bit is sign. 0 for positive, 1 for negative. Rest of number is the actual number.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Document Summary

1 + 1 = 0 (with a carry of 1: 1101 + 11 = 1000, conversions, ex. 365: find largest power of 2 that is closest to 365. (2^8 = 256) 1xxxxxxxx, 365 - 256 = 109. Find largest power of 2 that is closest to 109. (2^6 = 64). 101xxxxxx: keep going until you reach 0. Bites, bytes and words: a bit is a single binary digit (0 or 1, 8 bits is a byte, a fixed width of a collection of bits is a word, often 16, 32 or 64 bits. Hexadecimal numbers: base 16, 4 bits, 0 - 9 is numbers. 10 - 15 is letters a to f. Text to binary: ascii is most common encoding that computers use (7 bits, assigns each possible character to a fixed bit, nowadays, ascii is not enough for all characters of different languages.