Additional Course Material: Computer Basics, Hardware and Software
Additional Course Material: Computer Basics, Hardware and Software
)
A Focused Approach
Before taking printout of this chapter, please ensure that this material has not been covered
in the printed course material provided to you (by us).
People got along at 300 bps for quite a while. The reason this speed was tolerable was
because 300 bps represents about 30 characters per second, which is a lot more characters per
second than a person can type or read. Once people started transferring large programs and
images to and from bulletin board systems, however, 300 bps became intolerable. Modem
speeds went through a series of steps at approximately two-year intervals:
300 bps - 1960s through 1983 or so
1200 bps - Gained popularity in 1984 and 1985
2400 bps
9600 bps - First appeared in late 1990 and early 1991
19.2 kilobits per second (Kbps)
28.8 Kbps
33.6 Kbps
56 Kbps - Became the standard in 1998
ADSL, with theoretical maximum of up to 8 megabits per second (Mbps) - Gained
popularity in 1999
POST BOX NO.77, 2 ND FLOOR, SULTAN TOWERS, ROORKEE 247667 UTTARANCHAL PH: (01332) 266328 Email : [email protected] 1
TOTAL PAGES:
AMIE(I) STUDY CIRCLE(REGD.)
A Focused Approach
300-bps Modems
We'll use 300-bps modems as a starting point because they are extremely easy to understand.
A 300-bps modem is a device that uses frequency shift keying (FSK) to transmit digital
information over a telephone line. In frequency shift keying, a different tone (frequency) is
used for the different bits.
When a terminal's modem dials a computer's modem, the terminal's modem is called the
originate modem. It transmits a 1,070-hertz tone for a 0 and a 1,270-hertz tone for a 1. The
computer's modem is called the answer modem, and it transmits a 2,025-hertz tone for a 0
and a 2,225-hertz tone for a 1. Because the originate and answer modems transmit different
tones, they can use the line simultaneously. This is known as full-duplex operation. Modems
that can transmit in only one direction at a time are known as half-duplex modems, and they
are rare.
Let's say that two 300-bps modems are connected, and the user at the terminal types the letter
"a." The ASCII code for this letter is 97 decimal or 01100001 binary. A device inside the
terminal called a UART (universal asynchronous receiver/transmitter) converts the byte into
its bits and sends them out one at a time through the terminal's RS-232 port (also known as a
serial port). The terminal's modem is connected to the RS-232 port, so it receives the bits one
at a time and its job is to send them over the phone line.
Faster Modems
Faster modems are used by Internet users every day, notably cable modems and ADSL
modems. In telecommunications, "radio modems" transmit repeating frames of data at very
high data rates over microwave radio links. Some microwave modems transmit more than a
hundred million bits per second. Optical modems transmit data over optical fibers. Most
intercontinental data links now use optical modems transmitting over undersea optical fibers.
Optical modems routinely have data rates in excess of a billion (1x109) bits per second.
In order to create faster modems, modem designers had to use techniques far more
sophisticated than frequency-shift keying. First they moved to phase-shift keying (PSK), and
then quadrature amplitude modulation (QAM). These techniques allow an incredible
amount of information to be crammed into the 3,000 hertz of bandwidth available on a
normal voice-grade phone line. 56K modems, which actually connect at something like 48
Kbps on anything but absolutely perfect lines, are about the limit of these techniques (see the
links at the end of this article for more information).
MULTIPLEXING
In electronics, telecommunications and computer networks, multiplexing (short muxing) is a
term used to refer to a process where multiple analog message signals or digital data str eams
are combined into one signal. The aim is to share an expensive resource. For example, in
electronics, multiplexing allows several analog signals to be processed by one analog-to-
digital converter (ADC), and in telecommunications, several phone calls may be transferred
using one wire. In communications, the multiplexed signal is transmitted over a
P.B. NO.77, 2 ND FLOOR, SULTAN TOWERS, ROORKEE 247667 UTTARANCHAL PH: (01332) 266328 Email : [email protected] 2
AMIE(I) STUDY CIRCLE(REGD.)
A Focused Approach
communication channel, which may be a physical transmission medium. The multiplexing
divides the capacity of the low-level communication channel into several higher-level logical
channels, one for each message signal or data stream to be transferred. A reverse process,
known as demultiplexing, can extract the original channels on the receiver side.
A device that performs the multiplexing is called a multiplexer (MUX), and a device that
performs the reverse process is called a demultiplexer (DEMUX).
The two most basic forms of multiplexing are time-division multiplexing (TDM) and
frequency-division multiplexing (FDM).
An example of multiplexing
C Programming
P.B. NO.77, 2 ND FLOOR, SULTAN TOWERS, ROORKEE 247667 UTTARANCHAL PH: (01332) 266328 Email : [email protected] 3
AMIE(I) STUDY CIRCLE(REGD.)
A Focused Approach
Example
Solution
Example
Solution
CALLOC
This function is used to allocate storage to a variable whilst the program is running. The
function takes two arguments that specify the number of elements to be reserved, and the size
of each element (obtained from sizeof) in bytes. The function returns a character pointer
(void in ANSI C) to the allocated storage, which is initialized to zero's.
struct date *date_pointer;
date_pointer = (struct date *) calloc( 10, sizeof(struct date) );
The (struct date *) is a type cast operator which converts the pointer returned from calloc to a
character pointer to a structure of type date. The above function call will allocate size for ten
such structures, and date_pointer will point to the first in the chain.
SIZEOF
The sizeof() function returns the memory size of the requested variable. This call should be
used in conjunction with the calloc() function call, so that only the necessary memory is
allocated, rather than a fixed size. Consider the following,
struct date {
int hour, minute, second;
};
int x;
P.B. NO.77, 2 ND FLOOR, SULTAN TOWERS, ROORKEE 247667 UTTARANCHAL PH: (01332) 266328 Email : [email protected] 4
AMIE(I) STUDY CIRCLE(REGD.)
A Focused Approach
x = sizeof( struct date );
x now contains the information required by calloc() so that it can allocate enough memory to
contain another structure of type date.
FREE
When the variables are no longer required, the space which was allocated to them by calloc
should be returned to the system. This is done by,
free( date_pointer );
Other C calls associated with memory are,
alloc allocate a block of memory from the heap
malloc allocate a block of memory, do not zero out
zero zero a section of memory
blockmove move bytes from one location to another
P.B. NO.77, 2 ND FLOOR, SULTAN TOWERS, ROORKEE 247667 UTTARANCHAL PH: (01332) 266328 Email : [email protected] 5