MODULE 1: Introduction to Computing Science Flashcards
Computing science
study of computation and its application in problem-solving.
three fundamental concepts in computing science
data, algorithms, and programs.
data
raw info that the algorithm manipulates and processes to achieve a desired outcome
algorithm
set of instructions designed to solve a specific problem
program
set of instructions to the computer, to use the algorithm on the data
steps of Computational problem-solving refers
- Understanding the Problem
- Decomposition
- Algorithm Design
- Test and Refine
decomposition
break down program into smaller chunks
Algorithm Design
make an algorithm, or plan of action to solve each subproblem
Test and Refine
use sample data to test your algorithm, refine as needed
low-level view of memory
physical organization and structure of memory at the hardware level. involves understanding how memory cells are laid out, how they are addressed, and how data is stored in and retrieved from the memory
each memory cell represents:
a single byte of data,
how can a computer read/write the data contained within a memory cell?
each cell has a unique identifier, we can specify this address to direct the computer to the correct cell.
Bytes are exchanged between the CPU and main memory, allowing the CPU to read instructions and data from the main memory and write back into the main memory
main memory
where data is stored while in use. does not persist when computer turned off. Typicall, RAM
CPU
determines how instructions are interpreted and executed
bytes
a unit of data. Usually, eight binary digits
cpu consists of
control unit
program counter
arithmetic logic unit
control unit
decodes instructions, controls parts of cpu
program counter
acts liek bookmark, keeps track of what line of instructions needs to be executed next
arithmetic logic unit
perforths arithmetic and logical operations on binary data
How Do Computers “Run” Our Programs?
follow an instruction cycle, also known as the fetch-decode-execute cycle.
fetch-decode-execute cycle
program counter (PC) points at the next instruction in main memory that needs to be fetched. The line of instruction is fetched and brought into the CPU.
after fetching, The PC moves onto the next set of instructions, on standby
the fetched instruction is decoded and executed within the CPU, and the cycle continues.
high level vs low level programming language
high level = more basic, human friendly
low level = more complex, it’s the computer’s language, not human language
examples: high level, mid level, low level programming language
high = java, python
mid: C
low: Assembly Language
benefit of low level
Offers precise control over the hardware, allowing for direct manipulation of system resources
con of high level
Restricts direct hardware control in favor of simplicity, maintainability, and portability
python - Objects
specific entities in our program that have characteristics and behaviour
python - statement
instruction that a Python program understands and can execute
Python interpreter
program that reads, interprets and executes Python statements line by line.
hoe does Python interpreter work
parses
converts the statement to bytecode
translates bytecode instructions into machine code line by line.
machine code is then executed by the processor.
parsing
Python interpreter reads the code and analyzes its structure and syntax to understand its meaning.
bytecode
lower-level representation. middle-ground between our code and the machine code that the computer’s hardware understands.