How to convert a decimal to 4bit binary in BASIC language?

I am using BASCOM AVR and I would like to ask.

How to convert a decimal to 4 bit binary digit.

For example.

Convert 7 to 0111 Convert 8 to 1000 Convert 9 to 1001

Thank you very much

Reply to
sommes
Loading thread data ...

nibble

Reply to
techie_alison

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.