Algorithms and Architectures for HDR Systems