IST2010-Week13-Sample Project Traffic Light System
IST2010-Week13-Sample Project Traffic Light System
SYSTEM USING
ASSEMBLY LANGUAGE
ABSTRACT
• This report is made to cover all the aspects on the program of the traffic
light system made. It has explained what kind of signals are there and
for what purpose it’s there.
• There are different kind of signals for cars, pedestrians and also
equestrians.
• The apparatus used was emu8086 and the procedure to create the
program is evaluated using a flowchart. It covers the whole overview of
the process.
• The project was carried out to come up with a traffic lights control system
using assembly language program.
• It was simulated using an emulator.
• Assembly language is a low-level programming language for a particular
computer architecture in contrast to most high-level programming
languages, which are generally portable across multiple systems.
• Assembly language is converted into executable machine code by a utility
program referred to as an assembler like NASM, MASM.
INTRODUCTION
• For assembly language there are advantages and disadvantages, some of the advantages are
that it requires less memory during execution and time is likewise less used.
• Therefore, for the project assembly language of 8086 microprocessor was used to achieve the
results.
TYPES OF TRAFFIC LIGHTS
• Pedestrian Signals; These signals consist of Red and Green lights, but with a
silhouette of a man standing for the red, and a walking figure for the green.
• Wig-wag signals are traffic signals consisting of a set of three lamps mounted on
a rectangular board, with an upper pair of horizontally aligned red lamps which
flash alternately ('wig-wag') when in operation.
• Installation of the traffic sensor nodes into small holes centered in each lane in the
roadbed.
• Data collected by the nodes is used to compare the numbers of cars between the
lanes and access is granted based on the number of cars in each lane. It has the
usual green to red lights.
BENEFITS
• The first step was to come up with different situations that are possible
in traffic signals.
• Based on the flow chart, the program began execution with a delay of 5
seconds before all the red lights in each lane turned red.
• After another 5 seconds the north and south lanes get ready before the
lights turned green for the cars to move.
FLOW CHART
• A function to display the led lights was created with the help of the
different situations.
• Created a 5 seconds wait duration between the lights with the use of
hexadecimal digits to represent the time taken.
• The program displayed all the lights with cars moving across the lanes
effectively.
REGISTER RESULTS
Instruction AX BX CX DX
mov ax, 0000 0000 0045 0000
all_red
out 4, ax 0249 0000 0045 0000
mov ax, sit1 0249 0000 0045 0000
out 4,ax 030C 0000 0045 0000
mov cx, 4Ch 030C 0000 0045 0000
mov dx, 030C 0000 004C 0000
4B40h
mov ah, 86h 030C 0000 004C 4B40
int 15h 860C 0000 004C 4B40
PROGRAM RESULTS
• The results were accurate and showed how the cars coordinated with the signals-
if the lights turned red, the cars stopped, if they turned amber then the car got
ready to move and finally when the lights turned green, the cars started moving.
• For 5 sec;
For 20 sec;
Value for ax changes from 0000 to 8661
Value for ax changes from 0000 to 860C
Value of bx changes from 0000 to 0000 Value of bx changes from 0000 to 0000
Value of cx changes from 0045 to 004C Value of cx changes from 0045 to 0131
Value of dx changes from 0000 to 2D00
Value of dx changes from 0000 to 4B40
IMPROVEMENTS
• Furthermore we can improve on having more cars per lane and looking
at the results of the traffic timers then along with different delay times to
see the movement when there is traffic.
CODE USED
CONCLUSION
• The program created for the traffic lights worked well and it was made in order to help
improve the traffic system in the real world. Once this method is applied it will reduce
• The above problem/project operates similarly to the real life situation, i.e. the traffic light
• In addition, it also responds to different delay times to show that the program code is
correct and provides a smooth operation. However, the program can be modified to
increase the number of cars passing through as well as for emergency services i.e.
special access.