Академический Документы
Профессиональный Документы
Культура Документы
Lab Report: 04
Title of the experiment: Design & Implement
a circuit to display hexadecimal digits using trainer board
parallel port cable & seven segment display.
Submitted by
Nahida Sultana
Roll No:36
Jyoti Islam
Roll No:48
Kaniz Fatema Chowdhury
Roll No:66
Group:B
11th Batch
Submitted to
Ahsan Raja Chowdhury
Lecturer
Rumana Nazmul
Lecturer
Department of CSE
University of Dhaka
Prepared by
Jyoti Islam
Roll: 48
Title of the experiment: Design & implement a circuit to
display hexadecimal digits using trainer board, parallel port cable & seven
segment display.
Theory: One of the simplest and most popular methods for displaying
digits uses a seven segment display as shown in Fig.1.1. Seven-segment
displays are commonly used in electronics as a method of displaying
decimal numeric feedback on the internal operations of devices[1]. A seven
segment display, as its name indicates, is composed of seven elements.
Individually on or off, they can be combined to produce simplified
representations of the alphanumeric information.
The seven segments are identified with lower case letters from ‘a’ to ‘g’ and
most of them include a decimal point identified with ‘h’. By controlling the
Fig. 1.1: Seven Segment Display
current through the segments, some will be light and others will be dark so
that the desired character pattern will be generated[2].For example, to
display ‘3’, the segments a, b, c, d, and g are made bright while segment ‘f’,
‘e’ and decimal point ‘h’ is dark.
To give input, we write a code; the data is passed from trainer board to
computer using a circuit consists of logic gates. Then this input is passed to
the seven segment display by a parallel port cable which is known as DB-25
male to male parallel port cable (Fig. 1.3). This parallel cable has 25 pins in
both sides. Pin 2 to 9 are used as data pin, pin 18 to 25 are used as ground,
pin 10 to 15 are used as status port and pin 1,14,16 and 17 are used as
control port.
Fig. 1.3: DB-25 parallel port cable.
The pin configuration of the cable is shown in fig.1.4. To give input to the
circuit, we need to press a key of the keyboard. This value is passed to the
seven segment display by parallel port. To use the parallel port we write a
code where we call the function outportb( ) with 0x378 and the value
received from the keyboard using proper adjustment.
The function outportb() has two parameters. One is the port number, another
is the value passed to the port. Here, we use 0x378 as port number. The
value changes according to the input. We use a delay loop to watch the
output in seven segment display perfectly after each call of outportb( ).
To pass the input from trainer board data switches to processor, we need to
use a circuit consists of logic gates. Here we use two input OR gates for the
function. The diagram of a two input OR gate is shown in Fig. 1.5.
Here no.1,2;4,5;10,9;and no.13,12 pins are for inputs of the gates where
no.3;6;8;10and no.11 pins are for outputs respectively [1].
The connector side view of the parallel port cable is shown in fig. 2.2.
This conversion is related with the different segments of the display. For
example, to display ‘2’ we need to light the segments ‘a’, ‘b’, ‘g’ ,’e’ and ‘d’.
For this we pass 1 to these segments and 0 to segments ‘f’, ‘c’, and ‘h’. So,
we choose the decimal value 91 to call the outportb( ) function, because its
binary equivalent is 01011011 which is exact as the values of seven segment
display for displaying 2. The value calculation is shown in Table 1.
Table 1: Input/Output of the circuit
Input Data pins of the parallel Output
cable (seven
9 8 7 6 5 4 3 2 segment
Segments corresponding to display)
the data pins
Values from (Decimal
trainer board values)
H g f e d c b a
A B C D
0 0 0 0 63 0 0 1 1 1 1 1 1 0
0 0 0 1 6 0 0 0 0 0 1 1 0 1
0 0 1 0 91 0 1 0 1 1 0 1 1 2
0 0 1 1 79 0 1 0 0 1 1 1 1 3
0 1 0 0 102 0 1 1 0 0 1 1 0 4
0 1 0 1 109 0 1 1 0 1 1 0 0 5
0 1 1 0 125 0 1 1 1 1 1 0 1 6
0 1 1 1 7 0 0 0 0 0 1 1 1 7
1 0 0 0 127 0 1 1 1 1 1 1 1 8
1 0 0 1 103 0 1 1 0 1 1 1 1 9
1 0 1 0 119 0 1 1 1 0 1 1 1 A
1 0 1 1 127 0 1 1 1 1 1 1 1 B
1 1 0 0 57 0 1 0 0 0 1 1 0 C
1 1 0 1 63 0 0 1 1 1 1 1 1 D
1 1 1 0 121 0 1 1 1 1 0 0 1 E
1 1 1 1 113 0 1 1 1 0 0 0 1 F
int main( )
{
clrscr();
int i;
int a[16]={63,6,91,79,102,109,125,7,127,103,119,127,57,63,121,113};
while(!kbhit())
{
i=inportb(0x378);
if(i>15)
i=0;
i=i>>3;
outportb(0x378,a[i]);
delay(1000);
}
getch();
return 0;
}
Description of the experiment: In this section,
we’ll describe the necessary equipments for the experiment, the working
procedure of it and the sample input/output.
1. Computer.
2. Trainer Board.
6. Wires.
1. At first, we connect the 25 pin modem cable (male to male) with the
parallel port of the computer and the trainer board.
2. Then, we give power supply to the pc and trainer board and set up the
seven segment display IC on the breadboard of the trainer board.
3. We test the IC and modem cable to verify if they are working properly
or not. For this, we check pin no. 2 to 9 of the parallel port on the trainer
board using a LED.
4. We connect one end of a wire to pin no. 2 and the other end to the
positive end of the LED and then output 1 to parallel port which has port
no. 378h.
5. If the LED is on then pin 2 is ok and we move on to pin 3 and so on.
Then we connect pin no. 18 as ground.
6. Then, we ground pin no.3 and 8 of the seven segment display. We check
the seven segment display to find out which pin is connected with which
segment. For this, each time we connect a pin with data input pin of the
trainer board.
7. We give 1 to the pin and see the output in the seven segment display.
Thus we can identify the corresponding segment because only that
segment is turned on and others are turned off.
8. We find that, the segments ‘a’, ‘b,’ ‘c’, ‘d’, ‘e’, ‘f’, ‘g’ and ‘h’ are
connected with pin no. 2, 1, 7, 9, 10, 4, 5 and 6 respectively.
9. Then we connect the input pins of OR gates with data switches of trainer
board and give a constant zero to each of the gates. The output of the
gate is connected to the pin 10,11,12,13 and 15 no. pins of parallel port
cable respectively.
11. After completing the circuit connections, we run the code in the
computer, the circuit takes input from data switch of trainer board and in
the seven segment display shows the digit as output.
12.Then, we check the circuit for different inputs and check the output.
Since all the output was correct, it can be said that the design and
implementation of the circuit is perfect.
Sample input/output: Now we’ll show some sample input
and their corresponding output here.
Input Output
(binary value) (seven segment display)
1000
1010
1111
Precautions: It was really very important for us to have a close
look at the following precautions for the successful implementation of our
designed circuit.
2. All the pins of the parallel cable specially those of data port must
function properly.
4. The wires should be with sharp head. Loose wire connection should
be avoided. The connection should be given properly so that short
circuit can’t occur in the circuit.
Related books:
1. Ronald J. Tocci, Neal S. Widmer; Digital Systems, Prentice Hall
International, Inc. Dave Garza; Eighth edition,2002
Related websites:
2. www. wikipedia.org