Maybe you can read the article from Altschul et. al. But I am sure you will not read it or will be able to understand. As > 95 % of the people using BLAST have not read the paper or understood it (I am included too).
Altschul SF, Gish W, Miller W, Myers EW, Lipman DJ. Basic local alignment search tool. J Mol Biol. 1990;215(3):403-410. doi:10.1016/S0022-2836(05)80360-2
Nevertheless, do you yourself want to understand the algorithm or why are you doing what you are doing? If you have amino acid, why don't you go for simple BlastP? Generally BlastP is better than BlastN results.*
But for simple understanding, watch this, https://www.youtube.com/watch?v=1l2p_Q7QyB4.
What you actually want to do? Why are you using blast?