Intro to Binary Numbers - Why should you care?
- relating to, composed of, or involving two things.
- relating to, using, or expressed in a system of numerical notation that has 2 rather than 10 as a base.
- the binary system: binary notation.
- something having two parts.
Binary is about much more than counting with zeros and ones
- A way to represent letters, characters, and symbols (English, Spanish, Chinese, etc..) to computers. To a computer, there's no such thing as the number 23 or the letter "A". Those are representations meaningful to people, but they are actually a binary number on a lookup table that points to a picture of the letter "A" or the number 23.
- In addition to letters and numbers, computer designers represented command characters like Enter, Backspace, Shift, or Interrupt as binary so they could exist on the lookup table and map to keyboard keys.
- Bitwise operators = faster/cheaper than division and multiplication for low energy processors
- Binary logic AKA Boolean logic gives us boolean algebra. Boolean logic is a "BIG DEAL"
- Bitmasking, which is used in everything from compression to advanced video game graphics
Why is binary a big deal for computers and software development?
In a way, software development is all about representing patterns in order to represent information.
People have created all kinds of counting systems. Base 2, Base 10, Base 8, Base 16.
Computers and Base 2 work because a 0 represents off and a 1 represents on
Think of each binary exponent as a switch that can be turned on or off.
The first computers were physical computation machines. A clock is a physical computer!
The Ancient Greeks invented a machine called the Antikytera that computed months, seasons, and lunar/solar eclipses.
The second wave of computers were electrically powered, but analog. What does that mean?
- When you think analog, think old record players. They're electrically powered but not digital.
- This was when we used vacuum tubes and transistors. Computers were the size of entire rooms.
Digital computers store the on or off of a switch as a 0 or a 1. With digital representation of bits, we can store massive amounts of information on modern computers. A keyless remote for a vehicle these days has the same computing power and storage as the Apollo 11 Guidance Computer that got
Allows the expression of as many letters, numbers, symbols, and command codes in a byte as possible. A byte is 8 bits. For example, the ASCII has 256 characters, numbers, symbols, and control codes.
You can count to 1,023 on your fingers!
Each finger represents an exponent of 2 from 0 to 9
- ASCII lookup table https://www.ascii-code.com/
- Bitmasking and video game graphics https://gamedevelopment.tutsplus.com/tutorials/how-to-use-tile-bitmasking-to-auto-tile-your-level-layouts--cms-25673