![]() |
![]() ![]() |
Digital information may be represent in two distinct data formats -- "serial" and "parallel." Within a computer, say, to maintain the most rapid internal communication rate, each information bit is in carried on a single connection (wire). Thus, an informational word or bit configuration is carried on multiple connections in parallel (typically 4 parallel bits - a nibble, 8 parallel bits - a byte, 16 parallel bits, or 32 parallel bits). On an external communication channel, however, the informational word is carried in serial on a single connection (wire) as a time synchronous bit sequence. To communicate between computers we must be able to convert data formats from parallel-to-serial and from serial-to-parallel. Here we study how that conversion may be achieved.
- Subtask 9a: An important single bit memory element.
First we need to learn about "D Flip Flops." A D-FF is an very useful device for use in formatting digital signals. First examine and then build the following Simulink configuration. The inputs to the D-FF are labelled "D", "CLK" and "!CLR". The outputs are labelled "Q" and "!Q". Set your simulation parameters as follows: solver = fixed step/discrete; step = 1; and stop time = 99999999. Start the simulation. Notice that:Thus, we see that Q remembers the value of D at the moment when CLK rises from zero to one! Be sure that you believe this assertion.
- When !CLR = 0, Q = 0 and !Q = 1, no matter what the other inputs may be -- i.e.,!CLR = 0 "clears" or "resets" the outputs.
- When !CLR = 1, Q becomes equal to D at the moment when CLK "rises" from 0 to 1. At all other times Q is independent of D.
- Subtask 9b: A bit shift element.
To keep things as simple as possible, we will now use two D_FFs to convert two parallel bits into a time sequence of two bits. Examine and then build the following Simulink configuration. In this configuration you will see that the "word" [D1 D2} is saved as a parallel word [Q1 Q2] on rising CLK when the "control" switch is in the lower position. However, when the "control" switch is in the upper position, you will observe that the bit in Q1 is shifted to Q2 on rising CLK and we have the basic element of a parallel-to-serial converter. Set your simulation parameters as in Subtask 7a.
- Subtask 9c: A shift register.
Build and test the following parallel-to-serial shift register configuration. Set your simulation parameters as in Subtask 7a.
- Subtask 9d: Digital encoding of an analog signal.
Finally lets put it all together. Please build and study the following module which takes in an analog signal (perhaps an analog sample such as you obtained in Tasks 5 and 6) and converts it to a serial or time sequenced digital signal. Set your simulation parameters as in Subtask 7a. To get the A-to-D converter "sg_adconv4" go Here
To this end, I would like you build and study the following three configurations:
The heart of these model systems
is the MATHLAB function video129.
After you download
this function
and include it in the MATLAB search
path, you can read its file
header which explains in detail
how the function works or you can review its operation at any time by
writing
"help video129" in the MATLAB Command Window. Briefly, video129
is
a simulation of a video display in which you can control and modify the
display's characteristics. See an example of a
non localized spatial harmonic, an example of a
localized spatial harmonic, an example of an
arbitrary spatial pattern. Important:
After each invocation of
video129, you must close the video display
window. If you do not close the display window, the next
simulation
will hang-up and you will get an error message.
The display is synchronized to the simulation
clock by
the input "time" and the input "horiz_res" sets the
horizontal
resolution. In particular, the fixed horizontal dimension of the
display is swept in a time 1/horiz_res so that the horizontal
resolution
increases inversely with the scan rate. The input "line"
sets
the number of horizontal scans in a fixed vertical distance and, thus,
is the direct measure of the vertical resolution. Finally, the
input
"pixel" sets the luminance value at a given time instant and,
thus,
at a particular point on the display screen. The pixel inputs
should
be chosen to vary between 0 (black) and 100 (white). video129
returns
(outputs) the horizontal and vertical signals which may be observed and
compared with luminance signal on the muxed "Ramp Scope."