chapter 7 datapath assignment (changes in red)