Programming Flashcards
What is the number system and what is it used for?
Number system is system used to represent numbers and characters in computer-readable format
What are some types of number systems and their base?
decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16)
What is the binary notation of decimal number 1?
0001
What is the binary notation of decimal number 2?
0010
What is the binary notation of decimal number 3?
0011
What is the binary notation of decimal number 4?
0100
What is the binary notation of decimal number 5?
0101
What is the binary notation of decimal number 6?
0110
What is the binary notation of decimal number 7?
0111
What is the binary notation of decimal number 8?
1000
What is the binary notation of decimal number 9?
1001
What is the binary notation of decimal number 10?
1010
How do you convert binary code into a decimal number?
Input the binary code
Represent each bit of the binary code with the power of 2
Find the power values of each bit
Add the power values to obtain the decimal number
What is the method to convert a decimal number into binary code?
Input the decimal number
Divide the number by 2 and store the remainder
Repeat step 2 until the number cannot be divided
Display remainders in reverse order