Questions? Email

# 2.10 - What are binary numbers?

Edited: Oct 14

A. Introduction: why do computers use binary numbers?

Numbers have to be saved in computers so they can be used or calculated. The storage unit are electronic circuits. We have to use different "statuses" of the circuits to represent numbers. Since 2 different statuses are much easier to identify than 10 statuses, all computers use binary system for number storage and operations.

B. Watch (slides)

C. Try: how are arithmetic operations done in binary system?

11101 + 01010 = ? ; 1010101 + 1101010 = ? ;

11101 - 01010 = ? ; 1010101 - 1101010 = ? ;

11101 * 01010 = ? ; 1010101 * 1101010 = ? ;

11101 / 01010 = ? ; 1010101 / 1101010 = ? .

rtptyu
Jul 15, 2018

100111 10111111

10011 1001011

100110010 10010010010010

wangernestrdragon
Jul 15, 2018

1) 100111

2) 10011

3) 100100010

4) 0011

5)10111111

6)-0010101

7)10001000110010

8)0000000

mr.ricklu
Jul 15, 2018

100111;

10111111 ;

10011;

-101011

100100010 ;

10001100110010 ;

10;

0;

tian
Jul 15, 2018

100111; 10111111

10011; -10101

100100010; 10001100110010

10; 1

New Posts
• ## 5.2 - How to repeat some actions N times?

A. Introduction The third and last type of flow is all about repetitions: how to repeat some actions exact N times? or how to repeat some actions until certain status is achieved? There are actually three types of statements: for loops, while loops and do loops. B. Watch( Slides ) C. Try: Print out a multiplication table from 1 x 1 = 1 .... to 9 x 9 = 81. (Hint: you need a for loop inside a for loop)
• ## 5.3 - How to print out a triangular multiplication table?

A. Introduction You were asked to use for-loops to print out a multiplication table, for-loops and nested for-loops are widely used for many applications. Here are some examples. B. Watch( Slides ) C. Try to print out the upper half or the lower half of a multiplication table like this:
• ## 5.7 What's the difference between do...while and while?

A. Introduction do loops are essentially same at while loops except that they will run at least once. All three types of loops can be converted into each other... Which one to choose? B. Watch( slides ) C. Try this: Write a do loop that reads integers and computes their sum. Stop when reading a zero or the same value twice in a row. For example, if the input is 1 2 3 4 4, then the sum is 14 and the loop stops.