Java Reference
In-Depth Information
Unit
Bytes
Which is approximately
10 3 (1024 bytes exactly)
1 kilobyte (KB)
1024 bytes
10 6 (1,000,000 bytes)
1 megabyte (MB)
1024 kilobytes
10 9 (1,000,000,000 bytes)
1 gigabyte (GB)
1024 megabytes
10 12 (1,000,000,000,000 bytes)
1 terabyte (TB)
1024 gigabytes
10 15 (1,000,000,000,000,000 bytes)
1 petabyte (PB)
1024 terabytes
10 18 (1,000,000,000,000,000,000 bytes)
1 exabyte (EB)
1024 petabytes
10 21 (1,000,000,000,000,000,000,000 bytes)
1 zettabyte (ZB)
1024 exabytes
Fig. 1.4 | Byte measurements.
1.4 Machine Languages, Assembly Languages and High-
Level Languages
Programmers write instructions in various programming languages, some directly under-
standable by computers and others requiring intermediate translation steps. Hundreds of
such languages are in use today. These may be divided into three general types:
1. Machine languages
2. Assembly languages
3. High-level languages
Machine Languages
Any computer can directly understand only its own machine language , defined by its
hardware design. Machine languages generally consist of strings of numbers (ultimately re-
duced to 1s and 0s) that instruct computers to perform their most elementary operations
one at a time. Machine languages are machine dependent (a particular machine language
can be used on only one type of computer). Such languages are cumbersome for humans.
For example, here's a section of an early machine-language payroll program that adds over-
time pay to base pay and stores the result in gross pay:
+1300042774
+1400593419
+1200274027
Assembly Languages and Assemblers
Programming in machine language was simply too slow and tedious for most program-
mers. Instead of using the strings of numbers that computers could directly understand,
programmers began using English-like abbreviations to represent elementary operations.
These abbreviations formed the basis of assembly languages . Translator programs called as-
semblers were developed to convert early assembly-language programs to machine lan-
guage at computer speeds. The following section of an assembly-language payroll program
also adds overtime pay to base pay and stores the result in gross pay:
load basepay
add overpay
store grosspay
 
 
Search WWH ::




Custom Search