Search This Blog

Saturday, 16 February 2013

Debug–Binary Search

Sometimes, debugging of complicated circuits is an unavoidable task. To ease this process, some concept about binary search will proves to be helpful.
The idea about debugging using binary search as follow:
  • For a know series of circuit block that give un-expected result - always try to determine which half the the series that cause the problem
  • Repeat the iteration till faulty block found
For example:
In the diagram shown below, let x be the input, and output of each block be yn, where n is the block number, and block 15 coloured in red is the faulty block.
start: y16/x is not expected
  1. confirm y8/x is expected or not
  2. since y8/x is expected, we know the faulty block should be some where from block 9 to block 16, evaluate y12/y8
  3. since y12/y8 is working, faulty block should be some where from block 13 to block 16, evaluate block y14/y12
  4. y14/y12 is still working, faulty block should be some where from block 15 to block 16
thus regardless of where the faulty block is, the search terminate fast. In this example, if you were to use linear search method by evaluating from block #1 , block #2… , it will take you more time.

1 comment:

  1. Nice blog… Thanks for sharing very useful information about electrical circuits.
    Electronic circuit design