0% found this document useful (0 votes)
27 views10 pages

Ch1 Metric Prefixes Bit Questions

The document provides a comprehensive overview of powers of 2, metric prefixes, and bit representation in computing. It includes rules for converting bits to prefixes, minimum and maximum values in binary and 2's complement representation, and examples for calculating the number of bits needed for various integers. Additionally, it discusses the modulo operation and its behavior with binary numbers.

Uploaded by

2491178958
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views10 pages

Ch1 Metric Prefixes Bit Questions

The document provides a comprehensive overview of powers of 2, metric prefixes, and bit representation in computing. It includes rules for converting bits to prefixes, minimum and maximum values in binary and 2's complement representation, and examples for calculating the number of bits needed for various integers. Additionally, it discusses the modulo operation and its behavior with binary numbers.

Uploaded by

2491178958
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Metric Prefixes and

Bit Questions
Mohammad Ali Javidian
Powers of 2 – Memorize These
• 20 = 1 • 28 = 256
• 21 = 2 • 29 = 512
• 22 = 4 • 210 = 1024
• 23 = 8 • 211 = 2048
• 24 = 16 • 212 = 4096
• 25 = 32 • 213 = 8192
• 26 = 64
• 27 = 128
Metric Prefixes

Prefix Computers Engineering


Kilo (K) 210 = 1024 103 = 1,000 (Thousand)
Mega (M) 220 = 1,048,576 106 = 1,000,000 (Million)
Giga (G) 230 = 1,073,741,824 109 = 1,000,000,000 (Billion)
Tera (T) 240 = 1,099,511,627,776 1012 = 1,000,000,000,000 (Trillion)
Peta (P) 250 = 1,125,899,906,842,624 1015 = 1,000,000,000,000,000
Exa (E) 260 = billion billion 1018 = 1 followed by 18 zeros
Zetta( Z) 270 = 1024 billion billion 1021 = 1 followed by 21 zeros
Yotta (Y) 280 = million billion billion 1024 = 1 followed by 24 zeros

One byte is equivalent to eight bits. A bit is the smallest unit of data measurement.
A bit can be either 0 or 1.
Converting bits to prefix and vice
versa
• Rules for Exponents:
a) Zero Exponent Rule: ,
b) The Product Rule for Exponents: ,
c) The Quotient Rule for Exponents: ,
d) The Power Rule for Exponents: ,
e) Negative Exponent Rule:
• To convert bits to prefix and vice versa we use the product rule for
exponents as explained in the following examples:
• Example: 22 bits = 35 bits =
• 32K = 8G =
Minimum and Maximum in Binary
and 2's Complement Representation
• What is the smallest value we can express in 8 bits if we use unsigned
numbers? Express in binary?

• What is the biggest value we can express in 8 bits if we use unsigned


numbers? Express in binary?

• What is the smallest value we can express in 8 bits if we use signed


numbers (2's Complement)? Express in binary?

• What is the biggest value we can express in 8 bits if we use signed


numbers (2's Complement)? Express in binary?
Bit Questions: Minimums and
Maximums
Binary 2's Complement
How many
Bits Min Max Min Max
numbers?
(smallest) (largest) (smallest) (largest)
3 0 7 -4 3
4 0 15 -8 7
5 0 31 -16 15
6 0 63 -32 31
7 0 127 -64 63
15 K 0 32K-1 -16K 16K-1
29 0 512M-1 -256M 256M-1
0
How many bits in binary
needed?
To store the positive integer number in binary:
1) If , Find consecutive integers such that , is the number of bits that you
need.
2) If use the metric prefix notation first. Use step 1 and convert the results
at the end based on the powers of 2.
Example: How many bits required to store the following?
a) 200
b) 13,000
c) 3,000,000,000
d) 100,543,223,122,444
How many bits in 2's
Complement Representation
needed?
To store the positive integer number in 2's Complement Representation:
1) If , Find consecutive integers such that ,
is the number of bits that you need.
2) If use the metric prefix notation first. Use step 1 and convert the results at
the end based on the powers of 2.
Example: How many bits required to store the following (2's Complement)?
a) 200
b) 13,000
c) 3,000,000,000
d) 100,543,223,122,444
Modulo and bits
• Modulo or mod (%) – operation that divides two numbers and returns the
remainder.
Example:
• 12 mod 5 =

• 135 mod 2 =

• 3%5=

• Example: Find the least residues of 53 modulo 4 and of 107 modulo 11.
Behavior of modding by 4:
0 mod 4 0/4 = 0r0 0 = 00
1 mod 4 1/4 = 0r1 1 = 01
2 mod 4 2/4 = 0r2 2 = 10
3 mod 4 3/4 = 0r3 3 = 11
4 mod 4 4/4 = 1r0 4 = 00 (100 can't store 1)
5 mod 4 5/4 = 1r1 5 = 01 (101)
6 mod 4 6/4 = 1r2 6 = 10 (110)
7 mod 4 7/4 = 1r3 7 = 11 (111)
8 mod 4 8/4 = 2r0 8 = 00 (1000)
9 mod 4 9/4 = 2r1 9 = 01 (1001)
… …
• 2 bits acts like mod 4. This means when counting up, 2-bit number reset to
zero at 4. What mod does 5 bits act like?

You might also like