Docsity

CS 152 - Programming Paradigms [MIDTERM 1], Exams of Programming Paradigms

Toggle sidebar
bg1
CS 152 - Programming
Paradigms [MIDTERM 1]
(T/F) The earliest computers were reprogrammable. - ANSFalse -- they
executed a SINGLE, HARDWIRED program.
After machine language, a little better language was... - ANSassembly
language
In assembly, how were programs typed and read? (4 parts -- typed, read,
assembled, loaded) - ANS- typed: using the keypunch machine onto a card
- read: card reader read the punched card into memory
- assembler: translated assembly language program to machine code
(binary, 0 and 1)
- loader: loaded the machine code into computer memory
John von Neumann believed that computers should be... - ANSpermanently
hardwired with a small set of GENERAL PURPOSE operations -- operators
would input a series of binary codes to organize the basic operations to solve
more specific problems, and flip switches to enter these codes (machine
language) into memory
Machine language consists of... - ANSopcode - first 4 bits
operands - next 12 bits; they can be register numbers and memory locations
Machine language is comprised of which 2 digits for binary code? - ANS0 and
1
The Atanasoff-Berry computer could only... - ANSsolve linear equations
pf2

Partial preview of the text

Download CS 152 - Programming Paradigms [MIDTERM 1] and more Exams Programming Paradigms in PDF only on Docsity!

CS 152 - Programming

Paradigms [MIDTERM 1]

(T/F) The earliest computers were reprogrammable. - ANSFalse -- they executed a SINGLE, HARDWIRED program. After machine language, a little better language was... - ANSassembly language In assembly, how were programs typed and read? (4 parts -- typed, read, assembled, loaded) - ANS- typed: using the keypunch machine onto a card

  • read: card reader read the punched card into memory
  • assembler: translated assembly language program to machine code (binary, 0 and 1)
  • loader: loaded the machine code into computer memory John von Neumann believed that computers should be... - ANSpermanently hardwired with a small set of GENERAL PURPOSE operations -- operators would input a series of binary codes to organize the basic operations to solve more specific problems, and flip switches to enter these codes (machine language) into memory Machine language consists of... - ANSopcode - first 4 bits operands - next 12 bits; they can be register numbers and memory locations Machine language is comprised of which 2 digits for binary code? - ANS0 and 1 The Atanasoff-Berry computer could only... - ANSsolve linear equations

What are the disadvantages of machine language? (2) - ANS- tedious

  • error prone What was "programming" in the early days? - ANSwiring the hardware to perform a specific task What was the ENIAC? - ANSThe Electronic Numerical Integrator and Computer in 1946. It was "PROGRAMMABLE" -- the instructions that made it work were hard- wired, and each time a new sequence of instructions (program) was needed, the machine was REWIRED by manipulating switches and cables. What were drawbacks of assembly language? (2) - ANS- lacks abstraction = no way to implement loops
  • machine specific = each type of computer hardware had its own dialect of assembly What were the advantages of assembly over machine language? (3) - ANS- more readable and similar to English
  • can have comments using ";"
  • use of mnemonic symbols for instruction codes (LD, ADD, ST) and memory locations (FIRST, SECOND... = counting offsets not needed) When did assembly language first appear and is it still used today? If so, for what? - ANS1950s; yes, still used today for low-level system tools or for hand-optimization