subject

Computer architectureprogramming assignment 4: circuit simulatorintroductionyou have to write a circuit simulator. one of the inputs to your program will be a circuit description filethat will describe a circuit using various directives. your program will print the output of the circuit for allpossible input values.1 circuit description directivesthe input variables used in the circuit are provided using theinputvardirective. theinputvardirectiveis followed by the number of input variables and the names of the input variables. all the input variableswill be named with capitalized identifiers. an identifier consists of at least one character (a-z) followed by aseries of zero or many characters (a-z) or digits (0-9). for example, some identifiers arein1,in2, andin3.an example specification of the inputs for a circuit with three input variables: in1,in2,in3is as follows: inputvar 3 in1 in2 in3the outputs produced by the circuit is specified using theoutputvardirective. theoutputvardirective isfollowed by the number of outputs and the names of the outputs. an example specification of the circuit with outputout1is as follows: outputvar 1 out1the circuits used in this assignment will be built using the following building blocks: not, and, or, nand, nor, andxor. the building blocks can produce temporary variables as outputs, and can use either the input variables ortemporary variables as input. output variables will never be used as inputs in a building block. all the temporary variables will also be named with lower case identifiers (i. e.,temp1,temp2,temp3, specification of each building block is as follows: •not: for example, not in1 out1•and: for example, and in1 in2 out1•or: for example, or in1 in2 out1•nand: for example,1 nand in1 in2 out1•nor: for example, nor in1 in2 out1•xor: for example, xor in1 in2 out12 describing circuits using the directivesit is possible to describe any combinational circuit using the above set of directives. for example, the circuitout1 = in1.in2 + in1.in3can be described as follows: inputvar 3 in1 in2 in3outputvar 1 out1and in1 in2 temp1and in1 in3 temp2or temp1 temp2 out1note thatout1is the output variable. in1,in2, andin3are input variables. temp1andtemp2are temporaryvariables. a circuit description is a sequence of directives. you can assume that every temporary variable occurs as aoutput variable in the sequence before occurring as an input variable. note: a temporary variable can occur as an output variable in at most one directive.3 format of the input filesyour program will be given one file as input, containing the description of a circuit using the directivesdescribed above. for example: inputvar 3 in1 in2 in3outputvar 1 out1and in1 in2 temp1and in1 in3 temp2or temp1 temp2 out14 the problemyou have to write a program calledfirstas described above. you are guaranteed that the circuit descriptionsgiven as input to your program will be sorted. let’s look at an example we have encountered before. example executionsuppose a circuit description file named circuit. txt has the description for the circuitout1 = in1.in2 + in1.in32 inputvar 3 in1 in2 in3outputvar 1 out1and in1 in2 temp1and in1 in3 temp2or temp1 temp2 out1then, on executing the program with the above circuit description file, your program should produce thefollowing output: ./first circuit. txt0 0 0 00 0 1 00 1 0 00 1 1 01 0 0 01 0 1 11 1 0 11 1 1 1the output of the first three columns areinputvar in1,in2, andin3respectively. and the last columndenotes theoutputvar out1.note: the values of the input and output variables should be space separated and be in the same order as theoutput variables in , e. g., if the circuit description file has the directiveinputvar 3 in1 in2 in3, andoutputvar 3 out1 out2 out3, then the first values should be those of theinput variablesin1,in2, andin3, and output variableout1, followed by that ofout2, and then that ofout3.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Which one of the following would administrators use to connect to a remote server securely for administration? a. telnetb. secure file transfer protocol (sftp)c. secure copy (scp)d. secure shell (ssh)
Answers: 1
question
Computers and Technology, 22.06.2019 12:20
Usually, when we sniff packets, we are only interested certain types of packets. we can do that by setting filters in sniffing. scapy’s filter use the bpf (berkeley packet filter) syntax; you can find the bpf manual from the internet. set the following filters and demonstrate your sniffer program again (each filter should be set separately): (a) capture only the icmp packet. (b) capture any tcp packet that comes from a particular ip and with a destination port number 23. (c) capture packets comes from or to go to a particular subnet. you can pick any subnet, such as 128.230.0.0/16; you should not pick the subnet that your vm is attached to.
Answers: 3
question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 23.06.2019 17:30
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
Answers: 2
You know the right answer?
Computer architectureprogramming assignment 4: circuit simulatorintroductionyou have to write a cir...
Questions
question
History, 04.02.2021 03:40
question
Mathematics, 04.02.2021 03:40
question
Physics, 04.02.2021 03:40
Questions on the website: 13722360