#CS250#Information#Computer-Science
- Today’s computers use a binary symbol set
- Two symbol system to represent information in computers (primarily)
- Examples…
- Heads/Tails
- Modulo 2 Arithmetic
- Statements that are True/False
- 1/0
- Yes/No
- and so on
- A Bit is a binary digit
- A bit
- A Bit String - an ORDERED sequence of bits
- 1101 is a bit string, and is a different one from 1011
- 1 is a valid bit string (just a very short one)
- A Byte - an 8 bit bit-string
Representing Bits Electrically
- We use voltage on a wire to represent bits
- Use 2 distinct voltage bands with a gap to reduce representation errors
- We can represent a k-bit bit string using k wires, one per bit in the bit string.
- So if we wanted to represent a 128 bit bit-string, we would need 128 wires
- Bus - a collection of k wires carrying the k bits of a k-bit bit string;
- Bus diagram may be k lines or a single line labeled with k or with k understood implicitly
- Basically a bus is a collection of wires to carry k bits of a bit string. On diagrams, we don’t necessarily draw all the wires we just imply how many wires are actually necessary
Bit Strings
- Digital information is all compromised of bit strings
- Bit strings can represent anything (as long as there’s enough storage)
- Because of this, computers are broadly useful
- Bit strings by themselves have no meaning
- They gain meaning when paired with a representation
- Representation is a lens through which we view a meaning
- Pair a bit string with a different representation and you get a different meaning
- Representations
- Integers Representation
- Text Representation
- Floating Point Representation
- char, int, float, struct (the base data types)
- Image, Text (complex data types made up of more data types)
- A k-bit string is made of a sequence of k independent choices from {0, 1}
- There are distinct k-bit strings (From the Product Rule of combinatorics)
- k bits can
- be transported on just k wires
- yet can represent up to distinct values