Digital computer

What is a computer?

A computer* is a machine that can be programmed to carry out sequences of arithmetic or logical operations* automatically. Each operation is described by a specific instruction* or statement to be performed. Modern digital electronic computers have a generic set of operations and instructions,* and they have the capability to execute specific sets of them known as programs.* Each program describes and implements an algorithm* to solve a specific problem (e.g. performing a calculation, storing and retrieving information from a database etc.). The programs enable computers to perform a wide range of tasks. (cf. Wikipedia: Computers)

Keywords:
digital computer; arithmetic operation; logical operation; instruction; instruction set; program


A working definition of a digital computer:

A digital computer is a digital electronic machine that can be programmed to carry out sequences of operations automatically.


Examples

Example of a simple algorithm described by a flowchart diagram:

– arithmetic operation: + (addition)
– instructions: i←1 (assignment); i←i+1 (addition and assignment); write i (I/O instruction) etc.
– conditional instruction: (if) i>n (jump to stop); note that jump is performed when the i>n comparison provides 'true' logical value (i.e. 'yes')

A possible implementation of the above algorithm is as follows:

var n=10;
var i=1;

while(i<=n) {
 writeln(i);
 i=i+1;
 }

writeln("_____________");

This small JavaScript program can be executed using a simple JS interpreter available here. Because JavaScript is a high-level programming language which does not contain conditional or unconditional 'jump' (or 'goto') statements, we should use the 'while' loop statement instead. The while(i<=n) {...} loop statement repeats the sequence (or 'block') of statements between the {...} curly brackets until the (i<=n) comparison (called the 'condition' of the loop) provides 'true' logical value.



What does digital mean?

A digital* computer is a universal electronic data processing* equipment which uses fixed-length sequences of binary digits* to represent elementary or primitive types of data* (e.g. whole numbers or integers, real numbers, logical or Boolean values, characters etc.). The representation of data* imposes specific coding rules and internal format upon each of the primitive and complex data types defined in a computer system.

Keywords:
data processing; data; information; digital; digit; data type(s); data representation


Complex data types, e.g. strings, texts, long texts (cf. the "memo" field type, MS Access), arrays, database records etc., and various types of digital media (such as animations, digital images, sounds, videos etc.) also use binary encoding but the length and the number of the sequences of bits identifying elementary data units can be extremely diverse. For example, in a digital audio CD an elementary data unit can be 16 bits long (identifying the sound intensity at a given moment in one stereo channel), and the number of elementary data units depends on the actual length of the digitized sound.



Examples

Let us see some examples of the coding rules and internal format of a few elementary data types.

(1) examples of the coding rules and internal format of 8-bit integers:

(2) examples of the coding rules and internal format of real ("floating point") numbers:

(3) examples of the coding rules and internal format of logical values:

(4) examples of the coding rules and internal format of ASCII characters (represented by a sequence of 7 bits):



Boda István, 2024.