🖥️
Intro to Computer Science (ICS3U/C)
  • An Introduction to Computer Science
  • Videos & Slides
  • Unit 1: In the Beginning
    • The History of Computers
    • Binary & Logic
      • Bits and Bytes (Binary)
      • Transistors (Changing Bits)
      • Logic Gates
        • Poster
        • Logic.ly
    • The Parts of a Computer
  • Unit 2: Intro to Code
    • How Do We Code?
      • Coding Conventions (Rules)
      • Commenting Code
    • What is HTML?
      • Hello World! (in HTML)
      • HTML Slideshow
    • Hello World!
    • Input / Output
      • The Console
      • Prompt, Alert, Confirm
    • Variables & Data
      • Strings (Text)
      • Numbers (Values)
        • Converting & Rounding
        • The Math Object
          • Random Numbers
      • Booleans
        • Truthiness
      • Arrays
  • Unit 3: Control Flow
    • Conditionals (if this, do that)
      • If...Else
        • Logical Operators
      • Switch / Case
      • Ternary Operators
    • Loops (Repeating Code)
      • For...Loop
      • While & Do/While Loops
    • Debugging
  • Unit 4: Functions
    • Functional Programming
    • User Defined Functions
      • Hoisting and Scope
    • Calling a JS Function
  • TL;DR
    • Programming Basics
    • Slideshows & Demos
    • Javascript Syntax Poster
  • Advanced Topics
    • Recursion
    • Structures & Algorithms
    • Mmm... Pi
  • External Links
    • Typing Club!
    • repl.it
    • Khan Academy
    • Geek Reading
    • ECOO CS Contest
Powered by GitBook
On this page
  1. Unit 1: In the Beginning
  2. Binary & Logic

Bits and Bytes (Binary)

Electricity can be on or off. That's it. So how do computers hold numbers?

PreviousBinary & LogicNextTransistors (Changing Bits)

Last updated 6 years ago

A bicycle has two wheels, a binomial has two... nomials, and we (humans) are bipedal - we have two feet! Electricity has two states - on (1) and off (0). This means we need a number system that allows us to count using only two digits.

Decimal vs. Binary

Our decimal number system has ten 'digits', just like our fingers - which we also call digits (similar to 'digital' - no?). Our placeholders can have any of the digits 0 1 2 3 4 5 6 7 8 9. Once over 9, we increase the next placeholder by one and roll the 9 to 0.

Since electricity can either be on (|) or off (O), ether flowing (1) or not flowing (0), we are unable to use the decimal system to represent numbers - we only have two states, not ten!

Other great videos: - - - written samples

Binary Numbers and Base Systems | As Fast as Possible
Binary Tutorial
Why Do Computers Use 1s and 0s? Binary and Transistors Explained.
How Computers Work - Binary and Data
How Computers Work - Circuits & Logic
LogoLogic Puzzles | Solve a Puzzle