Skip to main content

Product Engineer II at Cadence Design Systems

Hello Dear Readers, Cadence Design Systems has a vacancy for a Product Engineer II role. Cadence is a pivotal leader in electronic design, building upon more than 30 years of computational software expertise. The company applies its underlying Intelligent System Design strategy to deliver software, hardware and IP that turn design concepts into reality.  Cadence customers are the world’s most innovative companies, delivering extraordinary electronic products from chips to boards to systems for the most dynamic market applications including consumer, hyperscale computing, 5G communications, automotive, aerospace industrial and health. The Cadence Advantage: The opportunity to work on cutting-edge technology in an environment that encourages you to be creative, innovative, and to make an impact. Cadence’s employee-friendly policies focus on the physical and mental well-being of employees, career development, providing opportunities for learning, and celebrating success in recog...

ARM Assembly Language Practice Question And Answer Part-2

  Hello Dear Readers, 

Today in this post I will provide some basics to advanced ARM's assembly language practice QA part-2, I have used the Keil tool for code writing.

Q-1). Write an assembly language program for storing the sum of first ‘n=6’ terms of the series 1,4,9,16,25…..

Code:

; program for the addition of the n=6 series 

area sum_series, code,readonly 

entry 

mov r2,#0 

mov r0,#6

loop 

  muls r1,r0,r0 ; multiply square number 

  add r2,r2,r1 ; whole sum is stored on register "r2" 

subs r0,r0,#1 

bne loop 

end 

Output:


Q-2). Write an assembly language program to find the maximum of 3 numbers and store it at location 0x5000.

Code:

; program to find maximum number of 3 and store in memory 

area max, code, readonly 

entry 

ldr r0,=data 

ldr r3,=0x5000 

ldr r4,=0x03 ;create a loop of 3 

ldr r1,[r0, #4] 

sub r4,r4,#1 

again 

 ldr r2,[r0] 

 cmp r1,r2 

 bcs loop ; jump on set carry 

 mov r1,r2 

loop 

 add r0,r0,#4 

 sub r4,r4,#1 

 bne again 

str r1,[r3] 

stop b stop 

data dcd 0x07,0x08,0x09 

end 

Output:


Q-3). Write an assembly language program for counting the total occurrences of a given ‘n=3’-bit pattern '110' in a 32-bit value.

Code:

; program to count occurance of the sequences in the given 32 bit value 

area count, code, readonly 

entry 

ldr r0, =data 

mov r3, #0 ; value of the occurance stored 

mov r4, #32 ;defined for one bit calculation 

mov r5, #6 

ldr r1, [r0] 

next 

 mov r1, r1, ror #1 

 mov r2, r1 

 ands r6, r2, r5 ; anding operation for identify sequences 

 subs r6, r6, r5 

 beq again 

 subs r4, r4, #0x1 

 bne next 

 b stop 

again 

 add r3, r3, #0x1 

 subs r4, r4, #0x1 

 bne next 

stop b stop 

data dcd 0x98654353 

end

Output:

Q-4). Write an assembly language program to count the total factors of a number.

Code:

; program to find totals number of factors 

area factor, code, readonly 

entry 

ldr r0,=data 

ldr r1,[r0] ; take example of 4 so number of factor is 3(i.e 1,2,4) 

mov r4,r1 

mov r2,#1 ; initial value for division 

mov r3,#0

next 

 cmp r4,r2 

 bcs loop1 

stop b stop 

loop 

 add r3,r3,#1 

again 

  add r2,r2,#1 

 mov r1,r4 

  b next 

loop1 

subtract 

  SUBS r1,r1,r2 

  beq loop 

  bhi subtract 

 b again 

data dcd 0x04 

end

Output:


Q-5). 
Write an assembly language program to find maximum and minimum values in an array.

Code:

; program to find maximum and minimum value from an array 

area max_min, code, readonly 

entry 

ldr r0,=data 

ldr r1,=0x05 

ldr r3,[r0] ; maximum value stored on r3 register 

ldr r4,[r0] ; minimum value stored on r4 register next 

 ldr r2,[r0] ; it is reference register 

 cmp r3,r2 

 bcs loop 

 mov r3,r2 

loop 

 cmp r4,r2 

 bls again 

 mov r4,r2 

again
  add r0,r0,#4 

  subs r1,r1,#1 

  bne next 

stop b stop 

data dcd 0x03,0x04,0x5,0x7,0x9 

end

Output:


Q-6). 
Write an assembly language program to find the average of first ‘n’ natural numbers.

Code:

; program for calculating average of 'N' natural numbers 

area avg,code,readonly 

entry 

ldr r0,=7 

mov r2,r0 

next 

 add r1,r1,r0 ; addition of all the numbers 7+6+5..... 

 subs r0,r0,#1 

 bne next ; repeat untill addition comes to 0 from the given value 

again 

 sub r1,r1,r2 ; For repeated subtraction 

 add r3,#1 ; r1 is stored remainder 

 cmp r1,r2 ; value in r3 is quotient 

 bge again 

end 

Output:


ARM Assembly Language Practice Question And Answer Part-1



Comments

  1. Wow bro I can't have words for you. Please keep it up to advanced algorithms.

    ReplyDelete

Post a Comment

Popular posts from this blog

SDC (Synopsys Design Constraints) contents part 4

Today, we will be discussing the remaining constraints mentioned in the SDC, which pertain to timing exceptions and design rules. This is the final part of the SDC contents. This is going to be interesting, especially with multicycle paths. Take time to read and try to comprehend. 10. set_max_transition     By setting max transition value, our design checks that all ports and pins are meeting the specified limits mentioned in SDC. If these are not satisfied then timing report will give DRVs (design rule violations) in terms of slack. This is specified as               set_max_transition 0.5  UBUF1/A setting maximum limit of 500ps on pin A of Buffer1. 11. set_max_capacitance     This is same as max transition, setting the maximum capacitance value. if our design not meeting this value then violation will occur. This will also reports under design rule violations in terms of slack.     set_max_capacitance 0.7 [all_...

Apprenticeship CAI at MediaTek Bangalore

Hello Dear Readers,   Currently at MediaTek Bangalore vacancy for an Apprenticeship CAI role. Job Description: B.Tech degree in Electrical/Electronics Engineering with a strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Encounter. Solid understanding of STA and timing constraints. Experienced in working on advanced process nodes (16nm). Strong expertise in Physical Verification to debug LVS/DRC issues at the block level. Requirement: B.Tech degree in Electrical/Electronics Engineering with strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Enc...

IC Physical Design (PnR) at Ulkasemi

Hello Dear Readers,   Ulkasemi  has a vacancy for an IC Physical Design (PnR) role. Job Overview: As a full-time Trainee Engineer, the individual will be working on IC Physical Design implementation from RTL to GDSII to create design databases ready for manufacturing with a special focus on power, performance & area optimization with next-generation state-of-the-art process technologies. Job Responsibilities: Perform physical design implementation which includes Floor planning, Power Planning, Clock Tree Synthesis, Place and Route, ECO, Logic Equivalence checks Timing analysis, physical & electrical verification, driving the sign-off closure meeting schedule, and design goals Develop flow, methodologies, and automation scripts for various implementation steps Follow the instructions, compile documents, prepare deliverables, and report to the team lead Should remain up to date with the latest technology trends Educational Qualification:   B.Sc/M.Sc   in EEE or...