Machine Language - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Machine Language

Description:

Extremely difficult and tedius to write programs in machine code, but this was ... hydrodynamics of explosions. statistics. game theory (pioneered MAD policy) ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 11
Provided by: BU48
Category:

less

Transcript and Presenter's Notes

Title: Machine Language


1
Machine Language
  • Computer hardware can process only a small number
    of primitive instructions
  • arithmetical and logical operations
  • program flow operations
  • moving data between memory and the CPU
  • Extremely difficult and tedius to write programs
    in machine code, but this was necessary before
    the invention of high-level languages (1950s).
  • Each instruction in a high-level language (such
    as Javascript, Basic, C, C, Java, Python,
    Pascal) is translated into a sequence of machine
    language instructions.

2
John Von Neumann (1903-1957)
  • Made deep contributions to
  • quantum physics
  • economics
  • computer science
  • hydrodynamics of explosions
  • statistics
  • game theory (pioneered MAD policy)
  • and various areas of classical mathematics

3
John Von Neumann (1903-1957)
  • On the Manhattan project, helped to work out the
    key ideas involved in thermonuclear reactions and
    the hydrogen bomb.
  • At 29, an original member of IAS (the
    demigods).
  • Pioneered the idea of a stored program
    computer. Before that, programming basically
    meant moving wires around.

4
Von Neumann Architecture
  • Registers
  • IR
  • PC
  • and more...

(RAM and ROM)
5
Fetch-Execute Cycle
  • Fetch the next instruction
  • Look in PC for location of next instruction, and
    copy that instruction into the IR.
  • Decode the instruction
  • Get data (if needed)
  • Instruction specifies location of data to be
    used. Copy data to registers.
  • Execute instruction

6
Simpletron
The Simpletron is a hypothetical computer
presented in the textbook Java How to Program
(by Deitel) for the purpose of explaining the
basic concept of machine language.
  • 3 registers
  • Accumulator
  • Instruction register (IR)
  • Program counter (PC)
  • Instructions are 4-digit decimal numbers.
  • Memory locations are numbered 00, 01, , 99.

7
I/O Instructions
  • 10xx (READ)
  • Read a number from the keyboard into memory
    location xx.
  • 11xx (WRITE)
  • Write a number from memory location xx onto the
    screen.

8
Load/Store Instructions
  • 20xx (LOAD)
  • Load a number from memory location xx into the
    accumulator.
  • 21xx (STORE)
  • Store a number from the accumulator into a memory
    location xx.

9
Arithmetic Instructions
  • 30xx (ADD)
  • Add a number from memory location xx
  • to the number in the accumulator.
  • 31xx (SUBTRACT)
  • 32xx (DIVIDE)
  • 33xx (MULTIPLY)

10
Transfer of Control Instructions
  • 40xx (BRANCH)
  • Copy xx into the program counter.
  • 41xx (BRANCHNEG)
  • Copy xx into the program counter if the number in
    the accumulator is negative.
  • 42xx (BRANCHZERO)
  • Copy xx into the program counter if the number in
    the accumulator is zero.
  • 43xx (HALT)
  • Terminate execution of the program.
Write a Comment
User Comments (0)
About PowerShow.com