Main content
Computers and the Internet
Course: Computers and the Internet > Unit 1
Lesson 1: Bits and bytesBits (binary digits)
Computers store information using bits. A bit (short for "binary digit") stores either the value start text, 0, end text or start text, 1, end text.
What fits in a bit?
A single bit can only represent two different values. That's not very much, but that's still enough to represent any two-valued state.
Is a lightbulb on or off?
State | Bit |
---|---|
start text, 0, end text | |
start text, 1, end text |
Is a button enabled or disabled?
State | Bit |
---|---|
start text, 0, end text | |
start text, 1, end text |
Is the current time AM or PM?
State | Bit |
---|---|
start text, 0, end text | |
start text, 1, end text |
Sequences of bits
Computers use multiple bits to represent data that is more complex than a simple on/off value.
A sequence of two bits can represent four (2, squared) distinct values:
start text, 0, end text, start text, 0, end text, start text, 0, end text, start text, 1, end text, start text, 10, end text, start text, 11, end text
A sequence of three bits can represent eight (2, cubed) different values:
start text, 0, end text, start text, 0, end text, start text, 0, end text, start text, 0, end text, start text, 0, end text, start text, 1, end text, start text, 0, end text, start text, 10, end text, start text, 0, end text, start text, 11, end text, start text, 10, end text, start text, 0, end text, start text, 101, end text, start text, 110, end text, start text, 111, end text
A sequence can represent many things: a number, a character, a pixel. Plus, the same sequence can represent different types of data in different contexts. The sequence start text, 10, end text, start text, 0, end text, start text, 0, end text, start text, 0, end text, start text, 11, end text could represent 67 in a calculator application while also representing the letter "C" in a text file. Learn more in our lessons on Binary numbers and Storing text in binary
Physical storage
Computers typically store bits using electromechanical transistors which can map electrical signals to either an on or off state. Learn more in our article From electricity to bits or this video on how transistors work.
🙋🏽🙋🏻♀️🙋🏿♂️Do you have any questions about this topic? We'd love to answer— just ask in the questions area below!
Want to join the conversation?
- How does the computer know whether a binary pattern results in the display of a letter or number?(26 votes)
- You (or the compiler you use) have to explicitly tell the computer how to interpret a bit string.
So when you write code you'd have to specify "This is a character" or "This is a binary number", high level programming language have functions to make that easier.(38 votes)
- I didn't understand how 4 bits can represent 16 values.Could you please explain.Thanks(7 votes)
- If we have 4 bits and each can be one of two values, then the number of combinations one can make with 4 bits is equal to 2*2*2*2 = 2^4 = 16.(13 votes)
- "At, what are electromechanical transistors?" 11:47(6 votes)
- it focuses on the interaction of electrical and mechanical systems as a whole and how the two systems interact with eachother.(2 votes)
- How does a computer know how to display this information?(7 votes)
- whenever i see computer specification there written
32 bit
64 bit
128 bit
i always wonder what this means(3 votes)- 32 bit and 64 bit refer to the addressable memory. A 32 bit computer can only use about 4 GB of RAM, whereas a 64 bit computer can use about 16 exabytes of RAM. 64 bit computers can often do more calculations per second, so they are faster.(6 votes)
- How do just two numbers make up an entire device(2 votes)
- Computers can't understand statements or requests like "Please put the picture of dogs on the top right page of the screen". For computers, it's total gibberish. The best way for computers to understand our requests are by the most simple types of questions possible - YES or NO. 1's and 0's simply respond to the computer asking "Does variable x = y?". So whatever question the computer asks, we can say YES or NO, 1 or 0. These questions can range from anything from "what is this letter" to "where is this item's coordinates". At the end of the day, computers just run on "should I do this", numerous times.(6 votes)
- Bits are binary digits (0 and 1)(2 votes)
- chả hiểu gì cả(3 votes)
- why is this topic so complicated and stressful given the fact that i literally just found out about it today?(3 votes)
- why are bits used to represent everything?(2 votes)
- Computers only understand information when it is in binary or in binary digits (Bits): 0 and 1.
So all we do is converted to bits so the computer can understand.(2 votes)