WEEK 1 - WEEK 1 This is a summary of Machine Language,...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
WEEK 1 This is a summary of Machine Language, Assembly Language, and High-Level Languages. This is a typed-up version of my CS107 lectures during Week 1, but it is being put online for all of my classes, because the information will be helpful in understanding how computers process the programs that you'll be writing this semester and in the future. ----------------------------------------------------------------------- --- MACHINE LANGUAGE, ASSEMBLY LANGUAGE, HIGH-LEVEL LANGUAGES Bit = "binary digit" = 0 or 1 Computers store information in bits. Usually, bits are grouped into units of 8 (one "byte"). Byte = 8 bits Kilobyte = 2^10 = 1,024 bytes Megabyte = 2^20 = 1,048,576 bytes Binary = base-2 number system = used by computers = digits are 0 and 1 Decimal = base-10 number system = used by people = digits are 0 to 9 Hexadecimal = base-16 number system = = easy way for programmers to write binary numbers = = digits are 0 to 9, and A to F Examples: decimal 19, written in binary, is 10011, because 1*(2^4) + 1*(2^1) + 1*(2^0)=19 decimal 19, written in decimal, is 19, because 1*(10^1) + 9*(10^0) = 19 decimal 19, written in hexadecimal, is 13, because 1*(16^1) + 3*(16^0) = 19 RAM = random-access memory. It's possible to read data from, and write data to, RAM memory. Therefore, your program, and any data your program uses or needs, is loaded into your computer's RAM memory. The more RAM memory your computer has, the bigger your programs and data can be. ROM = read-only memory. You can read the data values, but you can't change them. Usually, this is where important system-related programs and data are stored, by the company that made your computer. CPU = Central Processing Unit. Examples: the Intel Pentium microprocessor for PCs, the Intel 486
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
microprocessor for PCs, the Sun Ultra SPARC processor for UNIX machines, the G5 processor for Macs, etc. The CPU usually looks like a black plastic square or rectangle, usually about the size of a half-dollar, with short metal wires or connectors coming out of its sides. Inside this case is the CPU's electronics. The CPU is the "brain" of a computer -- it controls everything, does all the math, controls the reading/writing of data, executes the instructions in your program, etc. MACHINE LANGUAGE -- ------------------- 1. Each type of CPU is designed to only do certain things (i.e., to only perform certain tasks, such as "load a number from memory," "store a number into RAM memory," "add two numbers," "multiply two numbers," etc.) 2. But since CPUs can only understand numbers (patterns of "bits"), the commands that a programmer gives to the CPU must be given in terms of numbers. Therefore, a CPU's designers must pair a specific number code with each thing that the CPU can do. 3. Those specific numbers are usually called "Op Codes" (operations
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/17/2011 for the course CS 107 taught by Professor Ivanbajic during the Fall '08 term at San Diego.

Page1 / 6

WEEK 1 - WEEK 1 This is a summary of Machine Language,...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online