At each step, the values of all cells at a particular distance are added, and multiplied by the weight for that distance. Then the results for all distances are totalled. If the total is positive, the cell is set to value 1; otherwise it is set to value 0.