Models of computation
Arithmetic model
- Variables can hold any integer
- Each variable takes 1 unit of space
- Operations are +, -, *, /
- Each operation takes 1 unit of time
- Assignments, I/O, branching, comparisons take no time
Bitwise model
- Variables can have values 0 or 1
- Each variable takes 1 unit of space
- Operations are and, or, exclusive-or, not
- Each operation takes 1 unit of time
- Assignments, I/O, branching, comparisons take no time
Comparison model
- Variables can hold any integer
- Any mathematical operation can be done in no time
- Assignments, I/O, branching take no time
- Comparisons take 1 unit of time
Dan Hirschberg
Last modified: Oct 28, 2003