Programming language classification

Cards (44)

  • What are the two classifications of programming languages?
    Low-level and high-level languages
  • What are the two types of low-level languages?
    Machine-code and assembly language
  • What is an imperative high-level language?
    A language that consists of commands for the computer to perform
  • What are the advantages of machine-code and assembly language programming compared to high-level programming?
    They offer more control over hardware and can be more efficient
  • Who developed the Colossus Mark 1 computer?
    Tommy Flowers
  • In what year was the Colossus Mark 1 built?
    1943
  • What was the input method for the Colossus computer?
    A continuous loop of paper tape with 20,000 5-bit characters
  • How was the Colossus programmed?
    Using switches and plug panels
  • What was the output method for the Colossus computer?
    An indicator lamp panel
  • What was the purpose of the Colossus during World War II?
    To break the Enigma Code used by the Germans
  • What type of cipher was used in the Enigma Code?
    A Vernam-type cipher
  • What was the significance of the urgency in breaking the Enigma Code?
    It led to Britain's best brains being recruited to develop hardware and software
  • What was the typical memory cell in early computers made of?
    A vacuum tube the size of a light bulb
  • What components did early computers have?
    A control unit and an accumulator
  • How were early computers programmed?
    Using machine code entered with a series of switches
  • What does a typical instruction in machine code consist of?
    An operation code (opcode) and an operand
  • How many different instructions are possible using 8 bits for the opcode?
    256 different instructions
  • What is the largest value of the operand that can be held in 16 bits?
    65,535
  • What is an instruction set?
    All the instructions that a computer can understand and execute
  • What does the opcode 0000 do in machine code?
    Loads the value stored in memory location specified by the operand into the accumulator
  • What does the opcode 0001 do in machine code?
    Stores the value in the accumulator into memory location specified by the operand
  • What does the opcode 0010 do in machine code?
    Adds the value specified in the operand to the value in the accumulator
  • What does the opcode 0011 do in machine code?
    Compares the contents of the accumulator with the contents of the location specified by the operand
  • What are the two major improvements that assembly language introduced over machine code?
    • Each opcode was replaced by a mnemonic
    • The operand was replaced by a decimal (or hexadecimal) number
  • What is the relationship between assembly language and machine code instructions?
    There is a one-to-one correspondence between them
  • What does the instruction LDA do in assembly language?
    Loads the value stored in memory location specified by the operand into the accumulator
  • What does the instruction STO do in assembly language?
    Stores the value in the accumulator into memory location specified by the operand
  • What does the instruction ADD do in assembly language?
    Adds the value specified in the operand to the value in the accumulator
  • What does the instruction CMP do in assembly language?
    Compares the contents of the accumulator with the contents of the location specified by the operand
  • What does the sample program do in assembly language?
    1. LDA 13: Load the accumulator with the value at memory address 13
    2. ADD 14: Add the value at memory address 14 to the accumulator
    3. CMP 15: Compare the accumulator with the value at memory address 15
    4. BGT 6: If greater, branch to instruction at line 6 (STOP)
    5. STO 15: Store the accumulator value into memory address 15
    6. STOP: End the program
  • What advantages does assembly code bring to programmers?
    It is much easier to write, understand, and debug
  • What is a disadvantage of assembly code?
    It has to be translated into machine code by an assembler
  • What was the first high-level programming language invented?
    FORTRAN
  • How do FORTRAN statements compare to machine code?
    They look like Maths or English
  • What is the difference between imperative and declarative languages?
    Imperative languages consist of commands, while declarative languages focus on what the program should do
  • Name some examples of high-level languages.
    FORTRAN, Pascal, Delphi, Visual BASIC, Python
  • What does it mean for a language to be high-level?
    It allows programmers to think in terms of algorithms rather than hardware execution
  • What must happen before a high-level program can be executed?
    It must be converted into machine code
  • What is a key difference between assembly language and high-level languages?
    Assembly language has a one-to-one relationship with machine code, while high-level languages do not
  • What are the advantages of high-level languages over low-level languages?
    They are easier and faster to write, debug, and maintain