CSCI 223 Test 1 Flashcards
source program
created with an editor and saved in a text file (extension .c)
how many bits are in a byte
8
files that consist exclusively of ASCII characters are known as ?; all other files are known as
text files; binary files
? goes into the preprocessor and ? comes out
source program (text); modified source program (text)
? goes into the compiler and ? comes out
modified source program (text); assembly program (text)
? goes into the assembler and ? comes out
assembly program (text); object file (binary)
? goes into the linker and ? comes out
object file (binary); executable file (binary)
what programs perform the four phases of preprocessing, compiling, assembling, and linking?
preprocessor, assembler, compiler, linker
Why do we need to understand how compilation systems work?
to optimize program performance, understand link-time errors, and avoid security holes
assembly language definition
low-level programming language which is a human readable, textual representation of machine code
assembly language facts
each statement corresponds to a single machine code; each assembly language is specific to a particular processor architecture (ISA); it contains a lot of hardware info
ISA
Instruction Set Architecture: interface b/w software and hardware (e.g. x86, ARM, MIPS, …); assembly language is very important to the ISA
what translates high level languages to low level languages?
the compiler
examples of high level programming
C/C++, Java, …
examples of low level programming
x86, ARM, MIPS, …
a system is made up of
hardware and software
software is made up of
application programs and the operating system
hardware is made up of
processor, memory, I/O devices, etc.
ALU
arithmetic logic unit
what is the fastest yet smallest memory space?
the register file (inside the CPU)
onchip memory versus offchip memory
offchip: outside CPU and onchip: inside CPU (e.g. main memory is offchip; cache, register file is onchip)
onchip memory has (faster/slower) access time than main memory
faster
memory hierarchy generalization
smaller, faster, and costlier (per byte) storage devices at the top to larger, slower, and cheaper (per byte) storage devices at the bottom
memory hierarchy L0
registers
memory hierarchy L1
L1 cache (SRAM)
memory hierarchy L2
L2 cache (SRAM)
memory hierarchy L3
L3 cache (SRAM)
memory hierarchy L4
main memory (DRAM)
memory hierarchy L5
local secondary storage (local disks)
memory hierarchy L6
remote secondary storage (distributed file systems, web servers)
between levels ? and ? in the memory hierarchy is where we can differentiate onchip (above) and offchip (below)
L3 and up is onchip, L4 and below is offchip
main memory holds ? retrieved from local disks
disk blocks
cache holds ? retrieved from memory
cache lines
CPU registers hold ? retrieved from cache memory
words
why does the cache matter?
for performance; performance depends on access patterns
binary representation
everything is represented as a sequence of binary numbers in digital systems (0 or 1)
byte
8 bit chunk; smallest data access unit
each byte has a ? memory address
unique
machine code views memory as ?
a very large array of bytes (referred to as virtual memory)
widely-used numeral systems
decimal (base 10), hexadecimal/hex (base 16), octal (base 8), and binary (base 2)
how to convert from decimal to hexadecimal
divide by 16, read the remainders from bottom to top
how to convert from decimal to binary
divide by 2, use the remainders from bottom to top (should be 0s and 1s)
how to convert from hexadecimal to decimal
label the positions from right to left as 0, 1, 2, … and multiply the number by 16^? and add the results together
how to convert from binary to decimal
label the positions from right to left as 0, 1, 2, … and multiply the number by 2^? and add the results together
how to convert from binary to hexadecimal or binary to hexadecimal
use the chart
0x0
0000
0x1
0001
0x2
0010
0x3
0011
0x4
0100