1.2.4 Types Of Programming Language Flashcards
Programming paradigm
A philosophy, style or general approach to writing code
Imperative languages
A series of instructions that tell the computer exactly how to deal with a program and deal with a problem
3 types of imperative language
Structured, procedural and object-oriented
Structured
A series of procedures or functions that can be reused split a large program into manageable chunks
Declarative language
The user inputs the desired result but not how to get there and the computer does the work
Sets rules and answers questions
Logic programming
Expresses the logic of a computation without expressing its control flow
Defines a set of facts and rules based on the problem
Declarative language used
Medical diagnosis, oil exploration, processing natural language
Assembly language facts
Different for every type of processor
Assembler translates to machine code for execution
Each has it’s own instruction set called an instruction set architecture
What are the last 2 bits of the opcode?
The addressing mode, clarifies what the operand means
Little man computer
Only has 11 instructions
The imaginary computer it runs on has only 100 memory locations (7 bits)
LMC ADD x
Adds the contents of the memory address x to the value in the accumulator
LMC SUB x
Subtracts the contents of the memory address x from the value in the accumulator
LMC STA x
Stores the value in the accumulator in the memory address x
LMC LDA x
Loads the value in the memory address x to the accumulator
LMC HLT
Stops the program