Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews PC Hardware Interviews:80858086A + (Plus) HardwareA+ and Basic PCBasic ComputerBIOSCD-ROM DriveComputer ArchitectureComputer Architecture And DesignCPU (Central Processing Unit)ECDLElectronicsEmbedded SystemsFloppy DiskHard Disk (HD)Hardware and Software DesignHardware DesignIntel MicroprocessorLaptop Hardware RepairerMicroprocessorMotherboardRAMx86Zip Drive
Copyright © 2018. All Rights Reserved
Hardware and Software Design Interview Question:
Write a code to count the no. of 1s in a binary representation of a number?
Submitted by: AdministratorI am writing for Microcontrollers. ldi r16,$F0 ldi r17,$08 ldi r18,$00 ldi r19,$00 loop: rol r16 back: brcs one inc r19 dec r17 brne loop end:rjmp end one:inc r18 rjmp back
int count1s =0; while(num != 0){ if(num & 1 == 1){ count1s++; } num= num>>1; } printf("%d", count1s);
Submitted by: Administrator
int count1s =0; while(num != 0){ if(num & 1 == 1){ count1s++; } num= num>>1; } printf("%d", count1s);
Submitted by: Administrator
Copyright 2007-2025 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.