Question
BINARY KNAPSACK PROBLEM (easy68 simulator- assembly language) Definition The binary knapsack problem is defined as follows: Given a set of objects, O = O1, O2,
BINARY KNAPSACK PROBLEM (easy68 simulator- assembly language) Definition The binary knapsack problem is defined as follows: Given a set of objects, O = O1, O2, , On, with weights W = W1, W2, , Wn and values V = V1, V2, , Vn, and a knapsack (bag) with a maximum weight capacity K. The problem is to find the set of objects S with maximum value without exceeding a weight limit K. Project Write and test an Assembly Code for an instance of 16 objects. The code should print the set of objects, total weight and value of the best configuration. The code must be able to find the best solution for any set of 16 objects with randomly selected weights and values in the range 30 to 90, and knapsack weight limits of 400, 500 and 600. The Assembly Code should use only registers to find the solution, it is not allowed to build any data structures in the memory (Memory is used only for W, V and K parameters to be read). The code should be compact; 20 to 30 instructions only Hint: A brute force search is easy to implement with two nested loops in Assembly Language; No AI !
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started