a "bit" is atomic: the smallest unit of storageA bit stores just a 0 or 1"In the computer it"s all 0"s & 1"s" ... BitsAnything with two separate states can store 1 bitIn a chip: electric charge = 0/1In a hard drive: spots of North/South magnetism = 0/1A bit is too small to be much useGroup 8 bits together khổng lồ make 1 byteEverything in a computer is 0"s and 1"s. The bit stores just a 0 or 1: it"s the smallest building block of storage.
Byte
One byte = collection of 8 bitse.g. 0 1 0 1 1 0 1 0One byte can store one character, e.g. "A" or "x" or "$"
How Many Patterns With N Bits? (demo)
How many different patterns can be made with 1, 2, or 3 bits?
Number of bits Different Patterns
1
0 1
2
00 01 10 11
3
000 001 010 011 100 101 110 111
3 bits vs. 2 bitsConsider just the leftmost bitIt can only be 0 or 1Leftmost bit is 0, then append 2-bit patternsLeftmost bit is 1, then append 2-bit patterns again3-bits has twice as many patterns as 2-bits
Number of bits Different Patterns
1
0 1
2
00 01 10 11
3
000 001 010 011 100 101 110 111
In general: add 1 bit, double the number of patterns1 bit - 2 patterns2 bits - 4 3 bits - 84 bits - 165 bits - 326 bits - 647 bits - 1288 bits - 256 - one byteMathematically: n bits yields 2n patterns (2 to lớn the nth power)
One Byte - 256 Patterns (demo)
1 byte is group of 8 bits8 bits can make 256 different patternsHow khổng lồ use the 256 patterns?How to store a number in a byte?Start with 0, go up, one pattern per number, until run out of patterns0, 1, 2, 3, 4, 5, ... 254, 255One byte can hold a number between 0 & 255i.e. With 256 different patterns, we can store a number in the range 0..255 Really good for storing characters/letters.
"Byte" - unit of information storageA document, an image, a movie .. How many bytes?1 byte is enough to hold about 1 typed character, e.g. "b" or "X" or "$"All storage is measured in bytes, despite being very different hardwareKilobyte, KB, about 1 thousand bytesMegabyte, MB, about 1 million bytesGigabyte, GB, about 1 billion bytesTerabyte, TB, about 1 trillion bytes (rare)
Bytes & Characters - ASCII Code
ASCII is an encoding representing each typed character by a numberEach number is stored in one byte (so the number is in 0..255)A is 65B is 66a is 96space is 32"Unicode" is an encoding for mandarin, greek, arabic, etc. Languages, typically 2-bytes per "character"
Each letter is stored in a byte, as below100 typed letters takes up 100 bytesWhen you send, say, a text message, the numbers are sentText is quite compact, using few bytes, compared to images etc.