To convert a decimal no. to 2421 weighted code, do as follows:
Ex: 4 can be 2x0+4x1+2x0+1x0 here 4 is 0100
Any number > 4 has msb 1 whereas < 4 msb 0. It is known as self complementary bcz to get a number > 4 take 9's complement.
1 -- 0 0 0 1
2 -- 0 0 1 0
3 -- 0 0 1 1
4 -- 0 1 0 0
5 -- 9's complememt of 4 = 1 0 1 1
6 -- 1 1 0 0
7 -- 1 1 0 1
8 -- 1 1 1 0
9 -- 1 1 1 1
thus, 1234 in decimal can be written as 0001001000110100 in 2421 weighted code