edited by
3,758 views
21 votes
21 votes
  1. Assume that a CPU has only two registers $R_1$ and $R_2$ and that only the following instruction is available $XOR \: R_i, R_j;\{R_j \leftarrow R_i \oplus R_j, \text{ for } i, j =1, 2\}$

    Using this XOR instruction, find an instruction sequence in order to exchange the contents of the registers $R_1$ and $R_2$

  2. The line p of the circuit shown in figure has stuck at $1$ fault. Determine an input test to detect the fault.

edited by

4 Answers

Best answer
23 votes
23 votes
  • $R_1 \leftarrow R_1$ XOR $R_2$
  • $R_2 \leftarrow R_2$ XOR $R_1$
  • $R_1 \leftarrow R_1$ XOR $R_2$

Stuck at $0$ fault:: A stuck-at fault is a particular fault model used by fault simulators and automatic test pattern generation (ATPG) tools to mimic a manufacturing defect within an integrated circuit. Individual signals and pins are assumed to be stuck at Logical $'1', '0',$ and $'X'.$

Stuck at line $1$ means no matter whatever input we provide to the line the output is always $1.$
Now, when we take $A=1, B=1, C=1$ the required output, if no fault is there should be $1.$

But, since line p is stuck at logic $1$ final output of $A$ NAND $B$ will be $1$ only .So, final circuit output becomes $0.($which is wrong$)$

Reference : https://www.tutorialspoint.com/digital_electronics/stuckat1_fault_in_logic_circuit.asp

edited by
10 votes
10 votes
(a)
R2 $\impliedby$ R1 $\oplus$ R2
R1 $\impliedby$ R2 $\oplus$ R1
R2 $\impliedby$ R1 $\oplus$ R2

(b) A=1, B=1, C=1 should give output as 1 but as p is struck at 1 fault the output comes out to be 0.
5 votes
5 votes
stuck at 1 fault means we have doubt that p is always giving one , so we should give input (test vector ) such a way that it will pass input through the p as we have given for that input of A*B=0 for that three vectors (a=0,b=0),(a=1,b=0),(a=0,b=1) , now, how we will make sure that p is passing right input given by us or not when we put C=1 , and final output =0 it means yess , p has not stucked at 1

 

so test vector will be (a=0,b=0,c=1)(a=0,b=1,c=1)(a=1,b=0,c=1) so three test vectors are there for this question
0 votes
0 votes

A)

XOR R1 R2 ==> after excution R1 contains R1 $\oplus$ R2

XOR R2 R1 ==> after this original R1 value is stored in R2 and R1 contains R1 $\oplus$ R2  ( since  R2  $\oplus$ (R1 $\oplus$ R2) = R1)

XOR R1 R2 ==> after this original value of stored in R1

Thus with above code R1 and R2 values will get exhanged

 

B)

Our aim is to make a input so that output will depend on stuck at 1 line.

PROCEDURE TO FIND TEST VECTOR

1.We have to inactivate all inputs to last level gate except stuck line.

  • To inactivate input lines of AND and NAND gate put 1 for all inputs other than stuck at line so that output will depend on stuck at line.
  • To inactivate input lines of ORand NOR gate put 0 for all inputs other than stuck at line so that output will depend on stuck at line input.

2.Now give the opposite input to stuck at line( If line is stuck at one 1, give 0 as input and viceversa)

All possible inputs which satisfies will be test vecotors for a circuit.

Coming to question

Last level gate is NAND, so we inactivte input C i.e we take C=1

Since the other input to NAND is stuck at 1, we want to give opposite value, If A =B= 1, then we get 0 as input to last level NAND gate’s stuck at 1 line.

Therefore A=1,B=1,C=1 will be the test vector for given circuit.

If the output is 1, Then the circuit is working fine, Otherwise the line is stuck at 1

 

reshown by

Related questions

22 votes
22 votes
2 answers
1
Kathleen asked Oct 4, 2014
4,674 views
State True or False with one line explanationExpanding opcode instruction formats are commonly employed in RISC. (Reduced Instruction Set Computers) machines.
3 votes
3 votes
1 answer
2
gatecse asked May 3, 2021
2,324 views
State whether the following statements are True or False with reasons for your answer:A two pass assembler uses its machine opcode table in the first pass of assembly.
5 votes
5 votes
1 answer
3
gatecse asked May 3, 2021
1,278 views
State whether the following statements are True or False with reasons for your answerA symbol declared as ‘external’ in an assembly language program is assigned an ad...
5 votes
5 votes
5 answers
4
gatecse asked May 2, 2021
3,415 views
For a $B^+$ - tree of order $d$ with $n$ leaf nodes, the number of nodes accessed during a search is $O(\_)$.