i can't ell u the whole code but i think u'll be familier with
their formulas which converts then from binary to decimal and decimal to binay
try to implement those formulas i hope u can find thses in any book of ICS or
even every book which discuss thses operators but its better you to go for
Digital computer login and design's book you find them and if still u feel
problem them ask again i'll try to help you.