Starting from:

$25

EE2703-Assignment 1 Introduction to Python Solved

Write the pseudo code to do the following

1.    Accept the name of netlist file as commandline.

2.    Check if the user has actually provided the filename or not and give appropriate error message if needed.

It is always a good practice to validate the number of arguments given to the program. Note that a good program never crash. It will check for all the carelessness that can happen with the input and take necessary actions.

3.    Determine the section that contains the circuit definition (i.e., the portion that started with a .circuit line and ended with a .end line)

4.    Parse each line of the section and extract the words (tokens).

5.    Analyze the tokens and determine the from node, the to node, the type of element and the value. If it is a dependent source, you also need to extract additional information. Note that node names are alphanumeric.

6.    When all the lines have been read in, close the file.

7.    Traverse the circuit definition from last element to first and print out each line with words in reverse order. Eg: if the netlist is

.circuit

R... n1 n2 value

E... n1 n2 n3 n4 value

.end

Print

value n4 n3 n2 n1 E.... value n2 n1 R...

More products