Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet245/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   241   242   243   244   245   246   247   248   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

i
2
i
Written in Binary
0
1
1
1
2
10
2
4
100
3
8
1000
4
16
10000
5
32
100000
6
64
1000000
7
128
10000000
8
256
100000000
9
512
1000000000
10
1024
10000000000


Appendix

633
Many computers use 
word-level addressing
instead of 
byte-level addressing
. This means 
that the smallest unit that the computer operates on is a word. The word size varies com-
puter-by-computer. Older computers had 8-bit or 16-bit word sizes. More recent computers 
used a 32-bit word size but many computers today have 64-bit word sizes. In Section A.3, 
we will discuss storage capacities.
How do we represent meaningful information using binary numbers? For instance, 
what does 00000000 mean if stored in the computer? We want to store the following types 
of information in our computer.
• Positive (unsigned) integer numbers
• Positive and negative (signed) integer numbers
• Numbers with fractional parts (decimal points)
• Strings of characters
• Program instructions
• Images
• Animated images (video)
• Sounds (audio)
Each of these types of information will require a form of binary representation so that 
we can store them in the computer.
In Section A.2, we will examine how to store unsigned integer numbers in binary. 
Although it is interesting to see how signed integer numbers and fractions can be stored 
in binary, we will omit those details in this text because it is not particularly relevant with 
respect to Linux. Strings of characters are usually stored as individual characters, each 
stored in one byte or word. A string would then be stored in consecutive memory locations 
until we reach an “end of string” marker such as \0, which is used in C/C 
++
to denote the 
end of a string. Each character is stored in binary using a code. The most common codes 
are ASCII and UNICODE. In a similar way, we use codes to store program instructions. 
Images are stored using a bitmap or a compressed bitmap. Sounds use their own formatted 
file types. Again, while these types of storage are interesting, they are beyond the scope of 
this text. So, in the next section, we will concentrate on unsigned integer numbers.
A.2 CONVERTING UNSIGNED NUMBERS
Let us assume we are going to store a number in a single byte. As stated in the previous 
section, a byte can store any combination of eight 1s and 0s such as 00000000, 00001110, 
01010101, 11110000, 11111100, and 11111111. So, how do these 1s and 0s represent numbers 
that are meaningful to us? Let us reexamine Table A.1. The value 2
0
is 1, the value 2
1
is 2, 
and the value 2
2
is 4. In binary, we indicate these values as 1s in the 0th, 1st, or 2nd column 
of the binary number, counting from right to left. The number 100 (in binary) is 2
2
or 4. 


634

Appendix
Rather than writing “in binary,” we will note binary numbers by ending them with a 2 
subscript as in 100
2
(as opposed to 100, which would be one hundred). If 100
2
is 4 and 10
2
is 
2, then combining these two gives us 110
2
, which is 4 
+

=
6. This leads us to an easy way 
of converting numbers from binary to decimal.
We will use a simple formula for the conversion. In this case, we are assuming that our 
binary number is 1 byte long (consists of only 8 bits). The formula is
Value in decimal
=
=


Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   241   242   243   244   245   246   247   248   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish