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, 22.06.2019 15:00
The three logical operators used to write compound conditions are "and," "or," and "not." a: true b: false
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
You know the right answer?
Computer architectureprogramming assignment 4: circuit simulatorintroductionyou have to write a cir...
Questions
question
Mathematics, 27.05.2020 20:04
question
Mathematics, 27.05.2020 20:04
question
Social Studies, 27.05.2020 20:05
question
Mathematics, 27.05.2020 20:05
question
Mathematics, 27.05.2020 20:05
question
History, 27.05.2020 20:05
Questions on the website: 13722360