Digital computer

What is a computer?

A digital* computer* is an electronic* 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)

Related Wikipedia entries:
computer;⇒ arithmetic;⇒ program⇒

Vocabulary:
computer science terms⇒
essential vocabulary⇒


sample sentences, vocabulary, and tests to practice⇒



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 can be easily created using the JavaScript programming language 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 control statements (like 'jump' or 'goto'), 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, primitive or basic 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.

Related Wikipedia entries:
data processing;⇒
data;⇒ digital data;⇒ binary data;⇒
data type(s);⇒
data representation, including
signed numbers;⇒ binary coded decimals;⇒ real numbers;⇒ characters;⇒⇒⇒


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. Another example is a digital image that is composed of a number of picture elements called pixels. A two-dimensional raster image contains a fixed number of rows and columns of pixels. Each pixel represents a certain color (or gray level) at a specific point of the image. According to the well-known RGB color model, a specific color can be represented by the red, green and blue primary colors mixed together (i.e. adding them to each other in different intensities). In image file formats like jpg, the pixels are represented in 24 bits where the intensity of each primary color is represented by 8 bits.



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, 2025.