Design  | SFC  |  NOS  |  Code |  Diary  | WWW |  Essay |  Cisco | [Home]



[Bill's Home Page]
[ Old page]


One of the best-known software errors occurred on 22 July 1962 when the Mariner I rocket had to be blown-up, after it followed an erratic path after it took off. It was caused by a single incorrect character in a FORTRAN statement for the motion equations.

In 1963, ANSI defined the 7-bit ASCII standard code for characters. At the same time IBM had developed the 8-bit EBCDIC code which allowed for up to 256 characters, rather than 128 characters for ASCII. It is thought that the 7-bit code was used for the standard as it was reckoned that eight holes in punched paper tape would weaken the tape. Thus the world has had to use the 7-bit ASCII standard, which is still popular in the days of global communications.
Key characters to remember are:
'A' 41h 0100 0001
'a' 61h 0110 0001
'0' 30h 0011 0000

LF 0Ah 0000 1010
CR 0Dh 0000 1101

Mastering Comput-ing, W.Buchanan, Palgrave

Isn't that interesting?










Trains and Semaphores


lags are simple variables which take on a binary state (0 or a 1), and are used to identify that an event has occurred, or to pass binary information. Semaphores are positive integer values which can take on any range of values, but can also be binary values (for mutual exclusion applications). An example of using a semaphore is when a process uses a resource, and sets a semaphore flag to indicate that it is currently accessing the resource. Any device, which then accesses the resource while the semaphore flag was set, will know that the re-source is still being used, and must thus wait until the flag is unset. Semaphores were initially developed by Dijkstra and are implemented in IPC. Two common uses of semaphores are:

· Memory. This allows processes to share a common area of memory.
· File access. This allows processes to share access to files.

A semaphore could simply be a memory location in which processes go to and test the value. If the semaphore is set to a given value, a process may have to sleep until the value is changed to a value which allows orderly access to the resource. Semaphores can also be used to define critical code regions. These are parts of a process which must wait for code in another process to complete. A practical example of this is when we imagine two trains (two processes) approaching a region of single-track rail. For safety considerations there must only be one track on the single-track line, at a time. The trains must then have some way of signaling to the other train that they are now on the track. A signal (the semaphore) could be setup so that it is set either a red or a green light at the entrance of the track. When a train enters the track the signal will change to red, and stop any other trains from entering the track. When it has left the track the signal will be set to green, and the other train can enter the track. In software terms, the trains could be processes which require exclusive access to a resource. When one of the processes gets access to it, all other processes must wait for the resource to be released.

Chapter 6, Mastering Computing, W.Buchanan, Palgrave.

Comments on this essay

If you've got any comments on this essay (no matter if you agree or disagree with it), please send them to me using the form below.


Name (Surname, First Name):

[Not required]


Your comment


Note your comments may be published to a comments pages, but none of your details will be added to the comment, just the date that it was sent. Thank you.